From 20ab79577d3bfbb9c20aabfaab82ad715ae53bc2 Mon Sep 17 00:00:00 2001 From: Michael Saunby Date: Thu, 16 Feb 2023 19:09:48 +0000 Subject: [PATCH] updates (#18) * updates * extras --- README.md | 6 +- docs/deployment2.puml | 53 +++++++++++++ flaskserver/00README/LICENSE | 19 +++++ flaskserver/00README/revealjs.md | 3 + flaskserver/static/deployment2.svg | 123 +++++++++++++++++++++++++++++ flaskserver/static/slides.md | 33 ++++++++ 6 files changed, 236 insertions(+), 1 deletion(-) create mode 100644 docs/deployment2.puml create mode 100644 flaskserver/00README/LICENSE create mode 100644 flaskserver/00README/revealjs.md create mode 100644 flaskserver/static/deployment2.svg diff --git a/README.md b/README.md index 12f1d40..4bc955a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,6 @@ # building-docker-containers-in-github -Demonstration of how, and why, to build containers with GitHub Actions +Demonstration of how to build containers with GitHub Actions. + +The Flask webserver project in this repository is built and pushed to Docker Hub using GitHub Actions. + +See [the slides](flaskserver/static/slides.md). diff --git a/docs/deployment2.puml b/docs/deployment2.puml new file mode 100644 index 0000000..0e61acc --- /dev/null +++ b/docs/deployment2.puml @@ -0,0 +1,53 @@ +@startuml +!pragma layout smetana + +cloud "GitHub\n" { +card project [ + Project + ---- + Python app + .... + Dockerfile +] + +} + + +' thing +together { +cloud "Hosting service\n" { + + card image [ + Docker image + ---- + Base image + .... + Project + .... + Dependencies + ] + + card registry [ + Container registry + ---- + tag:latest + .... + tag:v1.1.0 + .... + tag v1.0.0 + .... +] + + card container[ + application + container + ] +} +actor "http://myproject.app" as a +} + +project --> image : " clone " +image -r-> registry : push +registry -> container : " pull " +container --> a +@enduml \ No newline at end of file diff --git a/flaskserver/00README/LICENSE b/flaskserver/00README/LICENSE new file mode 100644 index 0000000..0de9fdd --- /dev/null +++ b/flaskserver/00README/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2011-2023 Hakim El Hattab, http://hakim.se, and reveal.js contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/flaskserver/00README/revealjs.md b/flaskserver/00README/revealjs.md new file mode 100644 index 0000000..b8fce38 --- /dev/null +++ b/flaskserver/00README/revealjs.md @@ -0,0 +1,3 @@ +The slideshow part of the project uses Reveal.js. See https://github.com/hakimel/reveal.js/ and please note the licence conditions, which are copied here. + +Michael Saunby. February. 2023 diff --git a/flaskserver/static/deployment2.svg b/flaskserver/static/deployment2.svg new file mode 100644 index 0000000..67e8b31 --- /dev/null +++ b/flaskserver/static/deployment2.svg @@ -0,0 +1,123 @@ +GitHub Hosting service ProjectPython appDockerfilehttp://myproject.appDocker imageBase imageProjectDependenciesContainer registrytag:latesttag:v1.1.0tag v1.0.0applicationcontainerclonepushpull \ No newline at end of file diff --git a/flaskserver/static/slides.md b/flaskserver/static/slides.md index b385d19..4a5a64b 100644 --- a/flaskserver/static/slides.md +++ b/flaskserver/static/slides.md @@ -180,6 +180,8 @@ Deploying a container is very simple, we just tell the hosting service the URL o * Approve the pull-request +* Create a new release + * GitHub action builds and pushes the new image * Manually update the deployed version in Google Cloud @@ -189,14 +191,45 @@ Typically the last step is also automated, and there would be automated tests of +## Deployment + +### Build on GitHub + +![](deployment.svg) + + +### Build on Google, AWS, Docker, etc. + +![](deployment2.svg) + + + + ## What next? ### Google Cloud Shell +Click on ```[>_]``` for command line tools including git and docker. + +```sh +$ git clone +$ cd +$ docker build -t testimg . +.... +$ docker run -p 8080:5000 testimg +``` + ### Containers as development environments +"The Visual Studio Code Dev Containers extension lets you use a container as a full-featured development environment." + + + ### Docker Compose and Kubernetes + + + ## [The End](/) \ No newline at end of file