ci: multiarch build and push

This commit is contained in:
ngxson
2023-05-19 14:06:06 +02:00
parent 6bf4c92378
commit ff27eeebd6
2 changed files with 3 additions and 10 deletions

View File

@@ -14,12 +14,5 @@ fi
cp Dockerfile Dockerfile.tmp
sed -i "s/portainer-ce:latest/portainer-ce:$TAG/g" Dockerfile.tmp
if [ -z "$MULTIARCH" ]; then
docker build -t "$IMAGE:$TAG" -f Dockerfile.tmp .
else
echo "Multi-arch build..."
docker buildx create --use desktop-linux
docker buildx build --platform=$ARCHS -t "$IMAGE:$TAG" -f Dockerfile.tmp .
fi
docker push "$IMAGE:$TAG"
docker buildx build --platform=$ARCHS --push -t "$IMAGE:$TAG" -f Dockerfile.tmp .

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} MULTIARCH=1 ./scripts/build_and_push.sh`;
const command = `TAG=${tag} ./scripts/build_and_push.sh`;
return new Promise(resolve => {
const subproc = spawn('/bin/sh', ['-c', command], { cwd });