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

Multi arch docker build #28

Merged
merged 3 commits into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
uses: docker/metadata-action@v3
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason we need to change docker meta?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oops, just saw your comment, do we know for sure the tags will not change between the versions?

Copy link
Collaborator

Choose a reason for hiding this comment

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

After a short review of metadata-actions it seems the docker image tags remain the same. 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right, it seems that docker took over the action as the official owner, but the code is the same. The v1 -> v2 upgrade notes are here. AFAICT, the v1 -> v2 jump would not affect the behavior that's used in this repo. Then the v2 -> v3 jump was largely around the move to the new repo name.

with:
images: ${{ github.repository_owner }}/aws-auth

Expand All @@ -47,6 +47,6 @@ jobs:
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.17-alpine
FROM golang:1.17-alpine as build

RUN apk add --update --no-cache \
curl \
Expand All @@ -12,9 +12,12 @@ COPY . .
RUN git rev-parse HEAD
RUN date +%FT%T%z
RUN make build
RUN cp ./bin/aws-auth /bin/aws-auth \
&& chmod +x /bin/aws-auth
ENV HOME /root
RUN chmod +x ./bin/aws-auth

# Now copy it into our base image.
FROM gcr.io/distroless/base-debian11
COPY --from=build /go/src/github.com/keikoproj/aws-auth/bin/aws-auth /bin/aws-auth

ENV HOME /root
ENTRYPOINT ["/bin/aws-auth"]
CMD ["help"]