Skip to content
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

ci: build multi arch images with buildx #336

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rr-nick-tan
Copy link

@rr-nick-tan rr-nick-tan commented Mar 6, 2022

What this PR does / why we need it:

build multi arch images with buildx
fixes #335

Which issue this PR fixes

(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged)

  • fixes #

Special notes:

Checklist chart

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

  • Chart Version bumped
  • Variables are documented in the README.md

@rr-nick-tan rr-nick-tan force-pushed the master branch 3 times, most recently from def3b4d to 5a4c711 Compare March 7, 2022 00:44
@rr-nick-tan rr-nick-tan marked this pull request as ready for review March 7, 2022 00:51
@rr-nick-tan
Copy link
Author

@jtblin , pls review

when you create the git tag, it triggers the image build and publish to Docerhub
it works in my fork https://github.com/rr-nick-tan/kube2iam/runs/5441826765?check_suite_focus=true
to make the release work, you need to provide the github secrets DOCKERHUB_USERNAME and DOCKERHUB_TOKEN

Dockerfile Outdated
WORKDIR /go/src/github.com/jtblin/kube2iam
ENV ARCH=linux
ENV CGO_ENABLED=0
COPY . ./
RUN make setup && make build

FROM alpine:3.14.3
FROM --platform=$TARGETPLATFORM alpine:3.14.3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rr-nick-tan I think you can remove all your changes in this file. When the image is built by buildx it should automatically pick up the correct variant for the target platform. Maybe you can give it a try?

mirrors = ["mirror.gcr.io"]
- name: Build image
run: |
make docker
Copy link

@linki linki May 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could try using the build-and-push action to have it deal with all the buildx stuff. Here's an example that worked for me: https://github.com/linki/chaoskube/blob/1d44a96fd6f71d75dbcbf96f5a5a4b198913bcf1/.github/workflows/container-image.yml#L52-L59

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@linki can this be done as a separate PR? would appreciate if 0.11.0 multi-arch was published

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tburko Yes, sure 👍

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.

multi arch docker image for 0.11.0
3 participants