From 4b5093c53a3391f30e8c50911ec576127d74b898 Mon Sep 17 00:00:00 2001 From: Michael Saunby Date: Mon, 13 Feb 2023 20:33:01 +0000 Subject: [PATCH] improved homepage (#15) --- docs/gcloud.md | 10 ++++++++-- docs/resources.md | 6 +++++- flaskserver/static/slides.md | 30 ++++++++++-------------------- flaskserver/templates/home.html | 30 +++++++++++++++++++++++++++++- 4 files changed, 52 insertions(+), 24 deletions(-) diff --git a/docs/gcloud.md b/docs/gcloud.md index 284ce17..5a39350 100644 --- a/docs/gcloud.md +++ b/docs/gcloud.md @@ -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 @@ -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 ``` \ No newline at end of file diff --git a/docs/resources.md b/docs/resources.md index 5a5d865..97447e2 100644 --- a/docs/resources.md +++ b/docs/resources.md @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/flaskserver/static/slides.md b/flaskserver/static/slides.md index 4f28f6a..b385d19 100644 --- a/flaskserver/static/slides.md +++ b/flaskserver/static/slides.md @@ -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"] ``` @@ -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 @@ -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](/) \ No newline at end of file diff --git a/flaskserver/templates/home.html b/flaskserver/templates/home.html index 8a0f5a7..d45ef65 100644 --- a/flaskserver/templates/home.html +++ b/flaskserver/templates/home.html @@ -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; + } -
+

Building Docker containers in GitHub

+

Michael Saunby, University of Exeter

Slide show
GitHub

+
+

+ Credits +

+
presentation framework
+
https://revealjs.com
+
diagramming tool
+
https://plantuml.com
+
Docker overview
+
https://docs.docker.com/get-started/overview/
+
Docker Hub overview
+
https://docs.docker.com/docker-hub/
+
Google Cloud Run
+
https://cloud.google.com/run
+
+

Release: {{ version }}