Skip to content

Commit

Permalink
Cross build Docker images with multiarch/qemu-user-static
Browse files Browse the repository at this point in the history
  • Loading branch information
NI committed Oct 22, 2021
1 parent 4e87394 commit c719aad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ BUILD_TARGETS="darwin/amd64 windows/386 windows/amd64 openbsd/386 openbsd/amd64

DOCKER_BUILD_TARGETS="linux/amd64,linux/arm/v7,linux/arm64"
DOCKER_CLI_EXPERIMENTAL=enabled
DOCKER_BUILDKIT=1

SSHWIFTY_VERSION=$(git describe --always --dirty='*' --tag)
SSHWIFTY_COMMIT=$(git describe --always)
Expand Down Expand Up @@ -112,9 +113,11 @@ if [ "$SSHWIFTY_DEPLOY" = 'yes' ]; then
catch child \
'
docker login -u "$DOCKER_HUB_USER" -p "$DOCKER_HUB_PASSWORD" &&
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes &&
docker buildx create --use --driver docker-container --name buildx-instance &&
docker buildx inspect --bootstrap &&
docker buildx ls &&
docker buildx build --tag "$SSHWIFTY_DOCKER_IMAGE_PUSH_TAG" --tag "$SSHWIFTY_DOCKER_IMAGE_PUSH_TAG_LATEST" --platform "$DOCKER_BUILD_TARGETS" --build-arg GOMIPS=softfloat --build-arg CUSTOM_COMMAND="$DOCKER_CUSTOM_COMMAND" --progress plain --push .
docker buildx build --tag "$SSHWIFTY_DOCKER_IMAGE_PUSH_TAG" --tag "$SSHWIFTY_DOCKER_IMAGE_PUSH_TAG_LATEST" --platform "$DOCKER_BUILD_TARGETS" --builder buildx-instance --build-arg GOMIPS=softfloat --build-arg CUSTOM_COMMAND="$DOCKER_CUSTOM_COMMAND" --progress plain --push .
' \
'
mkdir -p ./.tmp/generated ./.tmp/release &&
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ jobs:
export DOCKER_CUSTOM_COMMAND='echo "GitHub Action Build"'
sudo add-apt-repository -y ppa:jacob/virtualisation
sudo apt-get update -y
sudo apt-get install -y qemu qemu-user-static binfmt-support
sudo systemctl restart docker
sudo apt-get upgrade -y
cp ./.ci.sh ./.github-action-ci-script.sh && chmod +x ./.github-action-ci-script.sh && time ./.github-action-ci-script.sh && rm ./.github-action-ci-script.sh

0 comments on commit c719aad

Please sign in to comment.