Skip to content
This repository has been archived by the owner on Jul 2, 2023. It is now read-only.

Commit

Permalink
#19 - multi-arch support
Browse files Browse the repository at this point in the history
  • Loading branch information
ozbillwang committed Apr 10, 2022
1 parent 6658483 commit 6a73384
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
20 changes: 17 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
sudo: required
language: bash

services:
- docker
dist: bionic

env:
- CI_NAME=travis DOCKER_CLI_EXPERIMENTAL=enabled

before_install:
- sudo rm -rf /var/lib/apt/lists/*
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- lsb_release -cs
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) edge"
- sudo apt-get update
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
- sudo service docker restart
- docker run --rm --privileged multiarch/qemu-user-static:register --reset

script:
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
- docker version
- bash ./build.sh
10 changes: 8 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,17 @@ do
done

if [[ ( $sum -ne 1 ) || ( $1 == "rebuild" ) ]];then
docker build --build-arg VERSION=${latest} --no-cache -t ${image}:${latest} .

if [[ "$TRAVIS_BRANCH" == "master" ]]; then
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
# docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker buildx create --use
docker buildx build --push --platform linux/amd64,linux/arm64 --build-arg VERSION=${latest} -t ${image}:${latest} -t ${image}:latest .
docker buildx build --push \
--platform linux/arm/v7,linux/arm64/v8,linux/arm/v6,linux/amd64,linux/ppc64le,linux/s390x \
--build-arg VERSION=${latest} \
-t ${image}:${latest} \
-t ${image}:latest .
fi

fi

0 comments on commit 6a73384

Please sign in to comment.