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

Add docker manifest #1001

Merged
merged 1 commit into from
Nov 14, 2022
Merged

Add docker manifest #1001

merged 1 commit into from
Nov 14, 2022

Conversation

gracegoo-stripe
Copy link
Contributor

@gracegoo-stripe gracegoo-stripe commented Nov 14, 2022

Reviewers

r? @vcheung-stripe
cc @stripe/developer-products

Summary

In this PR, I included the arch in the image template. This lets us pull the correct version when specifying the image with the arch like so:

➜  stripe-cli git:(gracegoo-docker-manifest) ✗ docker images
REPOSITORY          TAG             IMAGE ID       CREATED          SIZE
stripe/stripe-cli   latest-amd64    3bdd1fd31953   11 seconds ago   29.1MB
stripe/stripe-cli   v1.13.1-amd64   3bdd1fd31953   11 seconds ago   29.1MB
stripe/stripe-cli   latest-arm64    42447b0cbc8a   14 seconds ago   28.2MB
stripe/stripe-cli   v1.13.1-arm64   42447b0cbc8a   14 seconds ago   28.2MB

➜  stripe-cli git:(gracegoo-docker-manifest) ✗ docker image inspect 3bdd1fd31953 | jq '.[].Architecture '
"amd64"
➜  stripe-cli git:(gracegoo-docker-manifest) ✗ docker image inspect 42447b0cbc8a | jq '.[].Architecture '
"arm64"

However, we were no longer publishing to the old image names (ex. stripe/stripe-cli:latest) so they still returned an image with an stripe v1.13.0 with only the ARM64 build.

This change adds a docker_manifests step to the goreleaser, which will allow us to publish a manifest list to the previous image names. In other words, stripe/stripe-cli:latest will now become a manifest list that contains multi-arch images, and docker will figure out what specific image to pull down.

About docker manifests: https://docs.docker.com/engine/reference/commandline/manifest/
Following guide here.

Testing

I was not able to find a way to test this locally. I could run a snapshot version of the releaser but it bypasses the publishing step which also happens to bypass manifest builds:

 goreleaser release -f .goreleaser/linux.yml --rm-dist --snapshot

Warning from the goreleaser docs:
"Unfortunately, the manifest tool needs the images to be pushed to create the manifest, that's why we both create and push it in the publishing phase."

@gracegoo-stripe gracegoo-stripe merged commit 3b3ada5 into master Nov 14, 2022
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.

None yet

2 participants