-
Notifications
You must be signed in to change notification settings - Fork 319
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
base: master
Are you sure you want to change the base?
Conversation
def3b4d
to
5a4c711
Compare
@jtblin , pls review when you create the git tag, it triggers the image build and publish to Docerhub |
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 |
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.
@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 |
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.
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
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.
@linki can this be done as a separate PR? would appreciate if 0.11.0 multi-arch was published
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.
@tburko Yes, sure 👍
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)Special notes:
Checklist chart
[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]