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 hook for buildx xplat builds #4

Open
revitteth opened this issue Nov 28, 2022 · 1 comment
Open

Add hook for buildx xplat builds #4

revitteth opened this issue Nov 28, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@revitteth
Copy link
Contributor

Dockerhub automated build needs a hooks folder with a script which will enable builds for multiple platforms.

@revitteth revitteth self-assigned this Nov 28, 2022
@revitteth revitteth added the enhancement New feature or request label Nov 28, 2022
@revitteth
Copy link
Contributor Author

Something like:

#!/bin/bash

Specify the list of platforms to build for

platforms="linux/arm/v7,linux/arm64,linux/amd64"

Ensure that Docker Buildx is installed

docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

Set up Docker Buildx

docker buildx create --name mybuilder
docker buildx use mybuilder

Build the image for multiple platforms using Buildx

docker buildx build --platform $platforms -t myrepo/myimage:latest .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant