ci: add MULTIARCH
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user