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

Use buildx for cross architecture builds #532

Open
3 tasks
mStirner opened this issue Feb 6, 2025 · 2 comments
Open
3 tasks

Use buildx for cross architecture builds #532

mStirner opened this issue Feb 6, 2025 · 2 comments

Comments

@mStirner
Copy link
Member

mStirner commented Feb 6, 2025

docker buildx build --platform linux/amd64,linux/arm64 -t openhaus/backend:x.x.x
docker tag openhaus/backend:x.x.x openhaus/backend:latest
docker push openhaus/backend:x.x.x
docker push openhaus/backend:latest

Same for other images:

https://www.stereolabs.com/docs/docker/building-arm-container-on-x86

@mStirner
Copy link
Member Author

mStirner commented Feb 7, 2025

This is pure shit. You have to push directly into the registry:
docker buildx build --platform linux/amd64,linux/arm64 --push -t openhaus/admin-frontend:0.1.0 .

Use https://buildah.io/ instead https://danmanners.com/posts/2022-01-buildah-multi-arch/ ?

@mStirner
Copy link
Member Author

mStirner commented Feb 7, 2025

Or with ChatGPT, build single arch images, and merge them:

# Build and export amd64 image
docker buildx build --platform linux/amd64 --load -t openhaus/admin-frontend:0.1.0-amd64 .

# Build and export arm64 image
docker buildx build --platform linux/arm64 --load -t openhaus/admin-frontend:0.1.0-arm64 .

# Create multi-arch manifest
docker buildx imagetools create -t openhaus/admin-frontend:0.1.0 \
  openhaus/admin-frontend:0.1.0-amd64 \
  openhaus/admin-frontend:0.1.0-arm64

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

No branches or pull requests

1 participant