Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Introduce multiarch docker image build #466

Closed
wants to merge 1 commit into from

Conversation

commixon
Copy link

This PR tries to address this: #454

Our use case: We have migrated parts of our kubernetes clusters in AWS to graviton (arm) by introducing graviton based
nodegroups. It would be really nice to be able to utilize OCI's multiarch abilities, having the same charts and letting the container daemon choose the appropriate OS architecture build.

IMPORTANT: This PR is mostly a poc to kickstart the conversation to possibly support mutliarch builds, although it does work as it is.

  • Dedicated multiarch Dockerfile
    The reason for a discrete Dockerfile is in order to not mess any existing pipeline. The only diff between the two files is:
17c17
< RUN make bin/kiam-linux-amd64
---
> RUN CGO_ENABLED=0 go build -o bin/kiam cmd/kiam/*.go
21c21
< COPY --from=build /workspace/bin/kiam-linux-amd64 /kiam
---
> COPY --from=build /workspace/bin/kiam /kiam
  • Utilize github-actions with docker buildx functionality
    I am not really comfortable with drone ci, so that's why github actions are utilized here. Moreover, the docker/setup-qemu-action@v1, docker/setup-buildx-action@v1 and docker/setup-buildx-action@v1 seem to do all the complex multiarch work really well.

In case github actions are introduced to the upstream repo, there are 4 github repository secrets that are needed:
DOCKER_USERNAME: username used in drone.yml
DOCKER_PASSWORD: password used in drone.yml
DOCKER_REGISTRY: quay.io
DOCKER_ORGANIZATION: uswitch

Just for reference, here is a github action run from my fork: https://github.com/commixon/kiam/actions/runs/657481318 ,
and here is a successful multiarch build
Screenshot 2021-03-16 at 13 30 23

- Dedicated multiarch Dockerfile
- Utilize github-actions with docker buildx functionality
@pingles
Copy link
Contributor

pingles commented Mar 19, 2021

Very cool. I'm definitely open to us switching to GitHub actions for running the builds.

I'm not sure I have much time to take a look that soon but it's a really cool contribution!

@commixon
Copy link
Author

Btw if you need me to tweak anything or shape this somehow, just let me know. I was thinking that maybe this could be run in parallel with the drone ci for an easier transition, if time is an issue for you.

@astrikos
Copy link

That would be very useful for us as well if it goes though 🙏

@kevdowney
Copy link

Hi. Is this accepted?

We would also like to run Arm64 images in our clusters.

@rfasouliotis
Copy link

Any updates on this? We have started migrating to Arm64 as well so this would be awesome to have.

BTW, thanks @commixon! Used your images from above to test transitioning and they worked quite nicely! 👏🏽

@jontg
Copy link

jontg commented May 18, 2022

I got stuck trying to find good multi-arch images for v4.2 which includes some important library upgrades... https://hub.docker.com/r/jontg/kiam is multi-arch and has the latest changes from 4.2, build from https://github.com/airkit/kiam (I'm not opening a new PR since this one already has a more comprehensive change). Enjoy in good health!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants