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

Conversation

acmcelwee
Copy link
Contributor

I stumbled upon this tool whilst perusing the AWS EKS Best Practices Guide, and it seems like a great way to improve on how we're currently managing updates to our aws-auth configmap with Terraform.

One thing that's missing, though, is a docker image built for the arm64 architecture. With the rapid rise of Graviton2 and Apple Silicon, I can't imagine I'll be the first person to need an arm64 image to work with an EKS cluster.

While I was here, I updated the Docker meta build step to use the official docker/metadata-action to replace the crazy-max/ghaction-docker-buildx predecessor. You can see the guidance to do so in the repo for the old action.

Finally, I updated the Dockerfile to use multi-stage builds. This keeps the same build behavior that was in place before, but instead of having users download a docker image with the entire go buildchain, git, curl, aws cli, etc, the final assembled image is built on a Distroless base to reduce the surface area and risk of the container that will ultimately run.

If you need me to break out any of these changes from the others, or if you're only interested in a subset of the changes, let me know, and I can rework this PR.

Here's a test build in GH Actions where I ran through the entire docker build/push workflow, with the push going to my Docker Hub repo.

@acmcelwee acmcelwee requested a review from a team as a code owner March 29, 2022 17:08
@acmcelwee acmcelwee force-pushed the multi-arch-docker-build branch from 68df406 to 986f0bc Compare March 29, 2022 17:11
@@ -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.

@eytan-avisror
Copy link
Collaborator

Thanks for the PR @acmcelwee this is nice to have 👍

@codecov
Copy link

codecov bot commented Mar 30, 2022

Codecov Report

Merging #28 (986f0bc) into master (08b3bdd) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master      #28   +/-   ##
=======================================
  Coverage   81.00%   81.00%           
=======================================
  Files           4        4           
  Lines         300      300           
=======================================
  Hits          243      243           
  Misses         32       32           
  Partials       25       25           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 08b3bdd...986f0bc. Read the comment docs.

Copy link
Collaborator

@eytan-avisror eytan-avisror left a comment

Choose a reason for hiding this comment

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

LGTM

@eytan-avisror eytan-avisror merged commit 38531ba into keikoproj:master Mar 30, 2022
@acmcelwee acmcelwee deleted the multi-arch-docker-build branch March 30, 2022 17:07
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.

2 participants