-
-
Notifications
You must be signed in to change notification settings - Fork 545
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(ci): Build multi-arch Docker images (amd64
, arm64
)
#496
Conversation
Just looking to add ARM builds for my needs
Are you sure that this is all, which need to make the amd64 packages happily work with arm64? IE pre-commit-terraform/Dockerfile Line 75 in 1e623e8
|
Nope. I hadn't checked that far yet. Give me a bit and I can make it work though. |
@MaxymVlasov I think this should actually work now. I tested locally and could build it on both platforms, and I think I got the GH Actions config correct. |
In GHA
|
This PR has been automatically marked as stale because it has been open 30 days |
This PR has been automatically marked as stale because it has been open 30 days |
amd64
, arm64
)
@@ -97,7 +97,10 @@ All available tags [here](https://github.com/antonbabenko/pre-commit-terraform/p | |||
|
|||
**Build from scratch**: | |||
|
|||
When `--build-arg` is not specified, the latest version of `pre-commit` and `terraform` will be only installed. | |||
> **Note**: To build image you need have [`docker buildx`](https://docs.docker.com/build/install-buildx/) enabled as default builder. | |||
> Otherwise - provide `TARGETOS` and `TARGETARCH` as additional `--build-arg`'s to `docker build`. |
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.
Still don't get why don't we just set default value in Dockerfile =) This shouldn't prevent buildx
from overriding them. Or am I getting this incorrectly?
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.
buildx
is required for multi-arch builds. I'd like to force users to use buildx
when they build images from scratch, and because it's not our "core functional" there is no reason to maintain compatibility with legacy docker build
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.
Buildx exist at least for 3 years
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.
buildx
is required for multi-arch builds. I'd like to force users to usebuildx
when they build images from scratch, and because it's not our "core functional" there is no reason to maintain compatibility with legacydocker build
Makes sense.
Co-authored-by: George L. Yermulnik <[email protected]>
Co-authored-by: George L. Yermulnik <[email protected]>
# [1.78.0](v1.77.4...v1.78.0) (2023-04-28) ### Features * **ci:** Build multi-arch Docker images (`amd64`, `arm64`) ([#496](#496)) ([923c2c6](923c2c6))
This PR is included in version 1.78.0 🎉 |
Just looking to add ARM builds for my needs
Put an
x
into the box if that apply:Description of your changes
Add ARM builds for running on M1/M2 Macs and other Arm CPUs
How can we test changes
After building, run the following command and check that the output contains
amd64
,arm
andarm64
docker manifest inspect ghcr.io/antonbabenko/pre-commit-terraform:nightly | jq -r '.manifests[].platform.architecture' | sort -u