Skip to content

Commit

Permalink
improved homepage (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
msaunby authored Feb 13, 2023
1 parent 9aa7745 commit 4b5093c
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 24 deletions.
10 changes: 8 additions & 2 deletions docs/gcloud.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Docker in Google Cloud Shell

## Web preview

It's very easy to pull and run a container in Cloud Shell. e.g.

```sh
Expand All @@ -26,4 +24,12 @@ Deleted Containers:
f98f9c2aa1eaf727e4ec9c0283bc7d4aa4762fbdba7f26191f26c97f64090360

Total reclaimed space: 212 B
```

There's nothing to stop you building and pushing images from Cloud Shell.

Typically containers build on base images that provide a complete run time environment for the programming language used by the application. Where something more bespoke is needed then we can build on base images such as **ubuntu:22.04** and use a package manager to install libraries and tools. e.g.
```yaml
FROM ubuntu:22.04
RUN apt update && apt install -y --no-install-recommends r-base
```
6 changes: 5 additions & 1 deletion docs/resources.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
<https://learn.microsoft.com/en-us/azure/developer/python/tutorial-containerize-deploy-python-web-app-azure-04>
<https://github.com/features/actions>

<https://learn.microsoft.com/en-us/azure/developer/python/tutorial-containerize-deploy-python-web-app-azure-04>

<https://vsupalov.com/docker-arg-env-variable-guide/>
30 changes: 10 additions & 20 deletions flaskserver/static/slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,20 @@ The Dockerfile describes how to build the container and, optionally, the command
we need, Python and Pip, and the libraries. This is typically done be choosing an
appropriate base image.

```yaml
# Base Image
```yaml [1-14|1-9|11-14]
FROM python:3.11-slim-bullseye
# Working Directory
ARG VERSION
WORKDIR /app
# Install packages from requirements.txt
COPY requirements.txt /app/
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip &&\
pip install --no-cache-dir --trusted-host pypi.python.org -r requirements.txt
# Copy source code to working directory
COPY flaskserver /app/flaskserver
# Command to run
COPY flaskserver ./flaskserver

# Default env vars and command.
ENV PORT=5000
ENV VERSION=$VERSION
CMD ["python", "flaskserver"]
```

Expand Down Expand Up @@ -187,15 +189,6 @@ Typically the last step is also automated, and there would be automated tests of
## Docker pull and Docker run
```sh
$ docker run -p 5000:5000 flask-demo
```




## What next?
### Google Cloud Shell
Expand All @@ -205,8 +198,5 @@ $ docker run -p 5000:5000 flask-demo
### Docker Compose and Kubernetes
Typically containers build on base images that provide a complete run time environment for the programming language used by the application. Where something more bespoke is needed then we can build on base images such as **ubuntu:22.04** and use a package manager to install libraries and tools. e.g.
```yaml
FROM ubuntu:22.04
RUN apt update && apt install -y --no-install-recommends r-base
```
## [The End](/)
30 changes: 29 additions & 1 deletion flaskserver/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,45 @@
text-transform: None;
text-align: left;
}
.reveal h4 {
font-size: 0.65em;
text-transform: None;
text-align: center;
}
.reveal code {
font-size: 0.65em;
}
.reveal dt {
font-size: 0.5em;
}
.reveal dd {
font-size: 0.5em;
}
</style>
</head>
<div class="reveal" style="height:80%">
<div class="reveal" style="height:90%">
<h2>Building Docker containers in GitHub</h2>
<h4>Michael Saunby, University of Exeter</h4>
<p>
<a href="/static/slides.html">Slide show</a><br>
<a href="https://github.com/msaunby/building-docker-containers-in-github">GitHub</a>
</p>
<hr>
<p>
Credits
<dl>
<dt>presentation framework</dt>
<dd>https://<a href="https://revealjs.com">revealjs.com</a></dd>
<dt>diagramming tool</dt>
<dd>https://<a href=""plantuml.com">plantuml.com</a></dd>
<dt>Docker overview</dt>
<dd>https://<a href="https://docs.docker.com/get-started/overview/">docs.docker.com/get-started/overview/</a></dd>
<dt>Docker Hub overview</dt>
<dd>https://<a href="https://docs.docker.com/docker-hub/">docs.docker.com/docker-hub/</a></dd>
<dt>Google Cloud Run</dt>
<dd>https://<a href="https://cloud.google.com/run">cloud.google.com/run</a></dd>
</dl>
</p>
</div>
<p>
Release: {{ version }}
Expand Down

0 comments on commit 4b5093c

Please sign in to comment.