ci: multiarch build and push
This commit is contained in:
@@ -14,12 +14,5 @@ fi
|
|||||||
cp Dockerfile Dockerfile.tmp
|
cp Dockerfile Dockerfile.tmp
|
||||||
sed -i "s/portainer-ce:latest/portainer-ce:$TAG/g" Dockerfile.tmp
|
sed -i "s/portainer-ce:latest/portainer-ce:$TAG/g" Dockerfile.tmp
|
||||||
|
|
||||||
if [ -z "$MULTIARCH" ]; then
|
echo "Multi-arch build..."
|
||||||
docker build -t "$IMAGE:$TAG" -f Dockerfile.tmp .
|
docker buildx build --platform=$ARCHS --push -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"
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const shouldRebuild = !!process.argv.join(' ').match(/rebuild=true/);
|
|||||||
|
|
||||||
function build_and_push(tag) {
|
function build_and_push(tag) {
|
||||||
const cwd = path.join(__dirname, '..');
|
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 => {
|
return new Promise(resolve => {
|
||||||
const subproc = spawn('/bin/sh', ['-c', command], { cwd });
|
const subproc = spawn('/bin/sh', ['-c', command], { cwd });
|
||||||
|
|||||||
Reference in New Issue
Block a user