Skip to content

Commit

Permalink
ci: multiarch build and push
Browse files Browse the repository at this point in the history
  • Loading branch information
ngxson committed May 19, 2023
1 parent 6bf4c92 commit ff27eee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
11 changes: 2 additions & 9 deletions scripts/build_and_push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
echo "Multi-arch build..."
docker buildx build --platform=$ARCHS --push -t "$IMAGE:$TAG" -f Dockerfile.tmp .
2 changes: 1 addition & 1 deletion scripts/ci_cd.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down

0 comments on commit ff27eee

Please sign in to comment.