* Add one Dockerfile for each supported architecture
* Update multi arch hooks
* Create multi arch scripts
* Update README.md
* WIP. Use build args instead of multiple Dockerfiles in build script
* WIP. Fix typo mistake
* Use build args instead of multiple Dockerfiles in build script
* WIP. Build all the architectures in one DockerHub build
* Add arm64v8 architecture
* WIP. Testing build all the architectures in one DockerHub build
* Revert "WIP. Testing build all the architectures in one DockerHub build"
This reverts commit 94a89398a4120b183d2851ac7cb9c93db0e3d187.
* Refactor tag docker images in hooks/post_push files
* Use variables instead of positional arguments
* Export externally used variables
* Use ${variable//search/replace} instead of echo $variable | sed.
* Update README.md
* Add Cleanup in build.sh script
* Fix tagging error in post_push hook
* Add "-ex" flags to bash script
* Test tagging images in build hook
* Tagging in hook/post_build instead of hook/post_push
* Push built architecture dependent image
* Use Dockerfile argument instead of fixed value
* Fix typo
* Use parameter instead of global variable
* Use custom "hook/push" to prevent duplicated push
* Make a short doctype for each function declared in common
Certbot-Docker project
Goal
This project is used to publish on DockerHub a new version of the official Certbot Docker, and related Certbot DNS plugins Dockers, upon release of a new version of Certbot. It leverages the AutoBuild features of DockerHub to coordinate this publication through a continous integration/deployment approach.
High-level behavior
When a new version tag (eg. v0.35.0) is pushed to this repository, it triggers a new build in each DockerHub project, to construct and publish the new version of the Docker, containing the Certbot version corresponding to the pushed tag. With the example of the v0.35.0, the DockerHub projects will contain after few minutes a new tag v0.35.0, whose the Docker contains Certbot v0.35.0.
Configuration
To setup the publication process, the target DockerHub project must be configured appropriately. There are two types of DockerHub projects to take into account:
- the Docker project for Certbot core features (eg. certbot/certbot)
- a Docker project for Certbot DNS plugins (eg. certbot/dns-rfc2136)
-
Define a GitHub user with push rights to the current GIT repository.
-
Create the DockerHub project if necessary.
-
Activate the AutoBuild feature, using the current GIT repository as source (eg. https.//github.com/certbot/certbot-docker.git) and the user defined in 1).
-
Define a unique tag build rule in AutoBuild configuration:
For a Certbot core Docker -> Source:
/^(v[0-9.]+).*$/, Tag:{\1}, Dockerfile:Dockerfile, Build context:/coreFor a Certbot DNS plugin Docker -> Source:
/^(v[0-9.]+).*$/, Tag:{\1}, Dockerfile:Dockerfile, Build context:/plugin
Publication worfklow
Assuming the version to publish is v0.35.0
- Clone this repository locally, checkout branch
masterand ensure to have a clean workspace. - (Optional) Execute
./build.sh v0.35.0to test the Dockers builds. - Execute
./deploy.sh v0.35.0to trigger the publication of all Dockers withv0.35.0version.
Scripts usage
./build.sh [VERSION]
This script will build locally all Dockers for the given version using the same runtime than DockerHub. This can be used to test the build process before invoking the actual publication workflow.
./deploy [VERSION]
This script will trigger the publication on DockerHub of all Dockers for the given version. To do so, this script:
- update the relevant
README.mdfiles that will be used as description in the DockerHub repositories, - commit locally the modifications,
- tag this commit with the given version,
- push this tag and the updated
masterbranch.
Assuming the version to publish is v0.35.0, the following docker images will be created at DockerHub.
- certbot/certbot:v0.35.0 (amd64 architecture)
- certbot/certbot:amd64-v0.35.0
- certbot/certbot:arm32v6-v0.35.0
- certbot/certbot:arm64v8-v0.35.0
- certbot/certbot:latest (amd64 architecture)
- certbot/certbot:amd64-latest
- certbot/certbot:arm32v6-latest
- certbot/certbot:arm64v8-latest