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

feat: Build multiarch images #1257

Merged
merged 1 commit into from
Aug 22, 2024
Merged

Conversation

jiparis
Copy link
Member

@jiparis jiparis commented Aug 21, 2024

This PR introduces changes for building multiarch images with goreleaser. Note that it needs buildx, which in turn uses qemu binaries (that's the reason for the workflow changes).

Basically duplicates all docker configurations for both architectures (I've already checked that we use multiarch base images), and adds new docker_manifests for the multiarch index manifests.

Building locally:

> goreleaser release --clean --snapshot --skip=sign,sbom
...

Running (see the warning for AMD in MacOS with Rosetta)

✗ docker run ghcr.io/chainloop-dev/chainloop/cli:v0.96.2-amd64
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Chainloop Command Line Interface

Usage:
  chainloop [command]
...
✗ docker run ghcr.io/chainloop-dev/chainloop/cli:v0.96.2-arm64
Chainloop Command Line Interface

Usage:
  chainloop [command]

closes #1256

Signed-off-by: Jose I. Paris <[email protected]>
@jiparis jiparis requested review from migmartri and javirln August 21, 2024 09:31
- dockerfile: app/controlplane/Dockerfile.goreleaser
ids:
- control-plane
- chainloop-plugin-discord-webhook
- chainloop-plugin-smtp
- chainloop-plugin-dependency-track
image_templates:
- "ghcr.io/chainloop-dev/chainloop/control-plane:{{ .Tag }}"
Copy link
Member

Choose a reason for hiding this comment

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

Can this potentially break the images in the charts? Because of the change in the tag basically

Copy link
Member Author

Choose a reason for hiding this comment

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

Note that in the section below we are pushing this tag again, but as multiarch image instead. So basically nothing has changed.

Copy link
Member

@migmartri migmartri left a comment

Choose a reason for hiding this comment

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

nevemind, ignore my comments, I just read https://goreleaser.com/cookbooks/multi-platform-docker-images/#other-things-to-pay-attention-to

It would be useful to help reviewers to show any context of that change, i.e that link. The change is not trivial.

Thanks!

- name_template: "ghcr.io/chainloop-dev/chainloop/control-plane:{{ .Tag }}"
image_templates:
- "ghcr.io/chainloop-dev/chainloop/control-plane:{{ .Tag }}-amd64"
- "ghcr.io/chainloop-dev/chainloop/control-plane:{{ .Tag }}-arm64"
Copy link
Member

Choose a reason for hiding this comment

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

are you sure we are tagging with

"ghcr.io/chainloop-dev/chainloop/control-plane:{{ .Tag }}"?

also, do we need to have a different tag? I thought that it was in the same tag?

Copy link
Member Author

Choose a reason for hiding this comment

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

Tagging is done in docker_manifests section. Now {{ .Tag }} and latest are index manifests.

@jiparis jiparis merged commit 5a6c066 into chainloop-dev:main Aug 22, 2024
13 checks passed
@jiparis jiparis deleted the pfm-1033-1256 branch August 22, 2024 11:46
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.

Provide multiarch container images
3 participants