github.com/polarismesh/polaris@v1.17.8/release/standalone/build_standalone_docker.sh (about) 1 #!/bin/bash 2 3 set -e 4 workdir=${WORKDIR} 5 6 cd release/standalone 7 8 POLARIS_GIT_PATH=https://github.com/polarismesh 9 10 DIR_NAME=polaris-standalone-release_${SERVER_VERSION}.${GOOS} 11 rm -rf ${DIR_NAME} 12 mkdir ${DIR_NAME} 13 cd ${DIR_NAME} 14 15 arch_list=("amd64" "arm64") 16 platforms="" 17 18 for GOARCH in ${arch_list[@]}; do 19 SERVER_PKG_NAME=polaris-server-release_${SERVER_VERSION}.${GOOS}.${GOARCH}.zip 20 wget -T10 -t3 ${POLARIS_GIT_PATH}/polaris/releases/download/${SERVER_VERSION}/${SERVER_PKG_NAME} --no-check-certificate 21 22 CONSOLE_PKG_NAME=polaris-console-release_${CONSOLE_VERSION}.${GOOS}.${GOARCH}.zip 23 wget -T10 -t3 ${POLARIS_GIT_PATH}/polaris-console/releases/download/${CONSOLE_VERSION}/${CONSOLE_PKG_NAME} --no-check-certificate 24 25 LIMITER_PKG_NAME=polaris-limiter-release_${LIMITER_VERSION}.${GOOS}.${GOARCH}.zip 26 wget -T10 -t3 ${POLARIS_GIT_PATH}/polaris-limiter/releases/download/${LIMITER_VERSION}/${LIMITER_PKG_NAME} --no-check-certificate 27 28 wget -T10 -t3 https://github.com/prometheus/prometheus/releases/download/v2.28.0/prometheus-2.28.0.${GOOS}-${GOARCH}.tar.gz --no-check-certificate 29 wget -T10 -t3 https://github.com/prometheus/pushgateway/releases/download/v1.6.0/pushgateway-1.6.0.${GOOS}-${GOARCH}.tar.gz --no-check-certificate 30 31 platforms+="${GOOS}/${GOARCH}," 32 done 33 34 platforms=${platforms::-1} 35 36 cp ../linux/install.sh ./install.sh 37 cp ../linux/uninstall.sh ./uninstall.sh 38 cp ../prometheus-help.sh ./prometheus-help.sh 39 cp ../port.properties ./port.properties 40 cp ../docker/Dockerfile ./Dockerfile 41 42 echo "#!/bin/bash" >"run.sh" 43 echo "" >>"run.sh" 44 echo "bash install.sh" >>"run.sh" 45 echo "while ((1))" >>"run.sh" 46 echo "do" >>"run.sh" 47 echo " sleep 1" >>"run.sh" 48 echo "done" >>"run.sh" 49 50 docker_repository="polarismesh" 51 docker_image="polaris-standalone" 52 docker_tag=${SERVER_VERSION} 53 54 docker buildx build --network=host --build-arg SERVER_VERSION="${SERVER_VERSION}" --build-arg CONSOLE_VERSION="${CONSOLE_VERSION}" --build-arg LIMITER_VERSION="${LIMITER_VERSION}" -t ${docker_repository}/${docker_image}:${docker_tag} -t ${docker_repository}/${docker_image}:latest --platform ${platforms} --push ./