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

fix: use linux/amd64 platform only for m1/m2 macs (arm64) #2986

Merged
merged 5 commits into from
Aug 23, 2024

Conversation

k80bowman
Copy link
Contributor

Description

When we migrated the container:push command to oclif/core, we added a --platform flag that would be passed to Docker. We set it to equal linux/amd64 because that would allow users using m1 or m2 Macs to push builds to Docker. However, that is causing problems for our users with older Docker applications that don't accept the --platform flag (#2967).

This PR adds logic that checks the user's architecture and then only adds the --platform flag if the architecture is arm64.

Testing

Tests require to have a valid Dockerfile to build images, you can use the example app from this Devcenter article, but the Dockerfile might require a change on the dependencies installation command, adding the flag --break-system-packages to the pip3 install command.

  • Pull down this branch and run yarn && yarn build
  • Navigate to the directory where your Dockerfile lives
  • Start Docker if you haven't already
  • Run <path_to_cli>/bin/run container:login to login
  • Run <path_to_cli>/bin/run container:push. You may have to add a web or worker arg depending on your Dockerfile.

@k80bowman k80bowman requested a review from a team as a code owner August 22, 2024 14:53
@eablack eablack self-requested a review August 23, 2024 16:36
@k80bowman k80bowman merged commit 1e0bf11 into main Aug 23, 2024
8 checks passed
@k80bowman k80bowman deleted the k80/container-push-fix branch August 23, 2024 20:56
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