-
-
Notifications
You must be signed in to change notification settings - Fork 418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Docker buildx build workflow #116
base: master
Are you sure you want to change the base?
Conversation
This change will use Docker buildx to create a multi-architecture container (386, amd64, arm/v6, arm/v7, arm64, ppc64le, s390x) for the master branch and pushed tags. If a tag is pushed, the version will be tagged along with latest. If no tag is pushed, then only the latest tag will be updated.
Maybe we should add |
@npawelek This is a great starting point for multi-arch build. It would be great to integrate the following flags (under the PR) for selecting the arch for the build. |
At the moment the git tag This action has a Otherwise I'm 👍 for this @IslamAlam I have responded in your PR, what's notable here is that with this change, the |
This is how I tag one of my images: sudo --preserve-env=DOCKER_BUILDKIT,DOCKER_CLI_EXPERIMENTAL,COMPOSE_DOCKER_CLI_BUILD,HOME,PWD DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --platform linux/amd64 --platform linux/arm/v7 --platform linux/arm64 -t docker.io/supersandro2000/zeronet:latest -t docker.io/supersandro2000/zeronet:0 -t docker.io/supersandro2000/zeronet:0.7 -t docker.io/supersandro2000/zeronet:0.7.1 -t docker.io/supersandro2000/zeronet:0.7.1-r4478 --build-arg SHA=f3a839f422afd50f5bf8f17d83a8807571bc1dfe --build-arg BUILD_DATE=2020-04-30 --build-arg REVISION=0b413e1 --build-arg VERSION=0.7.1-r4478 --pull --push . Buildx is quite smart and can take multiple tags which I think we should utilize here. I generate the version numbers with the following Makefile line TAGS ?= latest $(shell echo $(VERSION) | cut -f1 -d".") $(shell echo $(VERSION) | awk -F '[.-]' '{print $$1"."$$2}') $(shell echo $(VERSION) | awk -F '[.-]' '{print $$1"."$$2"."$$3}') $(VERSION) |
I think this workflow can be cleaned up with the latest versions of Github actions from Docker |
I created an alternate approach at #378 |
This change will use
docker buildx build
to create a multi-architecturecontainer (386, amd64, arm/v6, arm/v7, arm64, ppc64le, s390x) for the master
branch and pushed tags. If a tag is pushed, the version will be tagged along
with latest. If no tag is pushed, then only the latest tag will be updated.
The only piece of information that you'll likely need to add is a secret for
DOCKER_PASSWORD
using a Docker Access Token. No credential artifacts are leftbehind in this process. The
docker login
information is added to.docker/config.json
which is deleted in the last task.In my testing, overall container build time is around 15 minutes. Feel free to
change as needed, this should be a good starting point.
Closes #112