Skip to content

Conversation

@mccutchen
Copy link
Owner

Initial implementation of #63.

@mccutchen mccutchen force-pushed the multi-arch-images branch from ed2cbff to 403fb35 Compare July 21, 2021 15:50
Comment on lines 144 to +148
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) .
Copy link
Contributor

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>

Copy link
Contributor

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

@danbf
Copy link
Contributor

danbf commented Aug 3, 2021

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.

Comment on lines +21 to +30
- 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
Copy link
Contributor

@danbf danbf Aug 4, 2021

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) .
Copy link
Contributor

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

@mccutchen
Copy link
Owner Author

Fixed in #64

@mccutchen mccutchen closed this Nov 3, 2021
@mccutchen mccutchen deleted the multi-arch-images branch November 3, 2021 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants