ci: add MULTIARCH

This commit is contained in:
ngxson
2023-05-19 13:35:53 +02:00
parent 76ec405a7f
commit 6f997bef9f
2 changed files with 10 additions and 2 deletions

View File

@@ -4,6 +4,7 @@
# Also build one for :latest
IMAGE="ngxson/portainer-ce-without-annoying"
ARCHS="linux/amd64,linux/arm64,linux/arm/v7"
if [ -z "$TAG" ]; then
echo "Please set TAG environment variable"
@@ -12,5 +13,12 @@ fi
cp Dockerfile Dockerfile.tmp
sed -i "s/portainer-ce:latest/portainer-ce:$TAG/g" Dockerfile.tmp
docker build -t "$IMAGE:$TAG" -f Dockerfile.tmp .
if [ -z "$MULTIARCH" ]; then
docker build -t "$IMAGE:$TAG" -f Dockerfile.tmp .*
else
echo "Multi-arch build..."
docker build --platform "$ARCHS" -t "$IMAGE:$TAG" -f Dockerfile.tmp .*
fi
docker push "$IMAGE:$TAG"

View File

@@ -10,7 +10,7 @@ const shouldRebuild = !!process.argv.join(' ').match(/rebuild=true/);
function build_and_push(tag) {
const cwd = path.join(__dirname, '..');
const command = `TAG=${tag} ./scripts/build_and_push.sh`;
const command = `TAG=${tag} MULTIARCH=1 ./scripts/build_and_push.sh`;
return new Promise(resolve => {
const subproc = spawn('/bin/sh', ['-c', command], { cwd });