bdcontract-bundle/docker/buildClusterDocker.sh
CaiHQ 09a80738f5 fix: support arm64/amd64 in push script
deprecated: NodecenterActions support JSON type contract execution.
2021-12-03 14:04:09 +08:00

23 lines
739 B
Bash
Executable File

#!/bin/bash
DOCKER_CLI_EXPERIMENTAL=enabled
cp ./docker/ClusterDockerfile ./router-backend/build/Dockerfile
cd ./router-backend/build
if [ $# -lt 1 ]; then
echo "missing arguments,\nusage: \$version [-,push,save] \$saveDir"
exit 1
fi
#linux/arm64/v8,
if [ "$2" == "push" ]; then
docker buildx build --platform linux/amd64,linux/arm64/v8 -t bdware/bdcluster:$1.arm64 ./ --push
elif [ "$2" == "save" ]; then
docker buildx build --platform linux/amd64 -t bdware/bdcluster:$1 ./ --load
docker save -o $3/bdcluster-$1.tar bdware/bdcluster:$1
else
# docker buildx build --platform linux/arm64/v8 -t bdware/bdcluster:$1 ./ --load
docker build -t bdware/bdcluster:$1 ./
docker tag bdware/bdcluster:$1 bdware/bdcluster:latest
fi