-
Notifications
You must be signed in to change notification settings - Fork 157
Build docker images for amd64 and arm64 #64
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
Conversation
ed2cbff to
403fb35
Compare
| image: | ||
| DOCKER_BUILDKIT=1 docker build -t $(DOCKER_TAG_DOCKERHUB) . | ||
| docker buildx build --platform linux/amd64,linux/arm64 -t $(DOCKER_TAG_DOCKERHUB) . | ||
|
|
||
| imagepush: image | ||
| docker push $(DOCKER_TAG_DOCKERHUB) | ||
| imagepush: | ||
| docker buildx build --push --platform linux/amd64,linux/arm64 -t $(DOCKER_TAG_DOCKERHUB) . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this needs to be re-jiggered based on how buildx works and how it needs a builder defined for it to use:
this has worked for me although the first step of ensuring any orphaned buildx builders could be improved be parsing the output of docker buildx ls
since buildx needs some setup, i do this on my end for multi-arch's:
ensure i cleared out the buildx builder in case it got interrupted before
docker buildx rm <builder-name>
then:
docker buildx create --name <builder-name>
docker buildx use <builder-name>
docker buildx build --tag <remote_tag> . --platform linux/amd64,linux/arm64,linux/arm/v7 --push
then clear out the buildx builder so it's ready for the next time i run it
docker buildx rm <builder-name>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i got it running in sso like this: buzzfeed/sso#319
|
i'm thinking this might be what's needed #65 have to look a little more. the biggest change is that with buildx, we don't store the image locally and then push, we need to build and push in one operation. so we might need to build twice, once for local stuff, tests, etc, and the other build and push up to dockerhub. |
| - name: Checkout | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - name: Setup go | ||
| uses: actions/setup-go@v2 | ||
| with: | ||
| go-version: '1.16' | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@v2 | ||
| - name: Set up docker buildx | ||
| uses: docker/setup-buildx-action@v1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
first off, you are doing some sophisticated stuff in here between the workflow and Makefile. that said since we are not pushing images in the workflow i don't see we need to make any changes to the workflow.
however if we do want to start pushing here, i think i found a guide:
https://github.com/docker/build-push-action/blob/master/docs/advanced/multi-platform.md
| # ============================================================================= | ||
| image: | ||
| DOCKER_BUILDKIT=1 docker build -t $(DOCKER_TAG_DOCKERHUB) . | ||
| docker buildx build --platform linux/amd64,linux/arm64 -t $(DOCKER_TAG_DOCKERHUB) . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think we need to change this, just the imagepush part
|
Fixed in #64 |
Initial implementation of #63.