Publish multi-arch images automatically with docker/github-builder#167
Publish multi-arch images automatically with docker/github-builder#167gy-mate wants to merge 4 commits intowiktorn:masterfrom
docker/github-builder#167Conversation
Switch from manual Docker image building and Docker Hub pushing to an automated workflow that also provides ARM64 builds on each release. It requires releases being created from now on at https://github.com/wiktorn/overpass-api/releases/new. It also uses the DOCKERHUB_TOKEN repository secret and DOCKERHUB_USERNAME repository variable. Both should be set manually first. Detailed changes: - Rename Dockerfile.template to Dockerfile to make it usable for the GitHub Action - ARG OVERPASS_VERSION instead of {version} Python field formatting - Remove curly bracket Python format field escaping from ENV declarations - Create docker-publish.yml which uses the new docker/github-builder GitHub action that makes configuring builds fairly simple
docker/github-builder
| data = response.read().decode(response.headers.get_content_charset()) | ||
| parser.feed(data) | ||
| with open("Dockerfile.template") as f: | ||
| with open("Dockerfile") as f: |
There was a problem hiding this comment.
With the changes in the Dockerfile, this whole script can be refactor just to return versions to build, and then build.sh can use those, to pass as an argument to docker command.
It would be nice to have a Github Workflow, that does similar thing as build.sh - building all versions, one by one, so they can reuse caches created by builds for other versions.
There was a problem hiding this comment.
With the changes in the Dockerfile, this whole script can be refactor just to return versions to build, and then
build.shcan use those, to pass as an argument to docker command.
I've implemented this in 3c699a3. Did you mean it like this?
There was a problem hiding this comment.
It would be nice to have a Github Workflow, that does similar thing as
build.sh- building all versions, one by one, so they can reuse caches created by builds for other versions.
As this would be a bit more complicated, would you mind if I leave this for later (for another PR), if someone wants to implement it?
I'd like to suggest switching from manual Docker image building and Docker Hub pushing to an automated workflow because it can also easily provide ARM64 builds on each release. (This would resolve #87.)
@wiktorn I don't know if it would fit into your workflow but the new process would require all new releases being created from now on at https://github.com/wiktorn/overpass-api/releases/new. Let me know if you like the idea of automated publishing but would prefer another trigger type!
The workflow would also use the
DOCKERHUB_TOKENrepository secret andDOCKERHUB_USERNAMErepository variable that have to be set manually first.Testing would also be needed to check if the Docker Hub push succeeds this way.
Detailed changes:
Dockerfile.templatetoDockerfileto make it usable for the GitHub ActionARG OVERPASS_VERSIONinstead of{version}Python field formattingENVdeclarationsdocker-publish.ymlwhich uses the newdocker/github-builderGitHub Action that makes configuring builds fairly simple