Skip to content

Commit

Permalink
docker:arm64镜像处理
Browse files Browse the repository at this point in the history
  • Loading branch information
chuntaojun committed Jan 13, 2023
1 parent c20f539 commit 2df4ba3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 32 deletions.
45 changes: 23 additions & 22 deletions .github/workflows/docker-standalone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,35 +83,36 @@ jobs:
for GOARCH in ${arch_list[@]}; do
SERVER_PKG_NAME=polaris-server-release_${SERVER_VERSION}.${GOOS}.${GOARCH}.zip
wget -T10 -t3 ${POLARIS_GIT_PATH}/polaris/releases/download/${SERVER_VERSION}/${SERVER_PKG_NAME} --no-check-certificate
CONSOLE_PKG_NAME=polaris-console-release_${CONSOLE_VERSION}.${GOOS}.${GOARCH}.zip
wget -T10 -t3 ${POLARIS_GIT_PATH}/polaris-console/releases/download/${CONSOLE_VERSION}/${CONSOLE_PKG_NAME} --no-check-certificate
LIMITER_PKG_NAME=polaris-limiter-release_${LIMITER_VERSION}.${GOOS}.${GOARCH}.zip
wget -T10 -t3 ${POLARIS_GIT_PATH}/polaris-limiter/releases/download/${LIMITER_VERSION}/${LIMITER_PKG_NAME} --no-check-certificate
wget -T10 -t3 https://github.com/prometheus/prometheus/releases/download/v2.28.0/prometheus-2.28.0.${GOOS}-${GOARCH}.tar.gz
wget -T10 -t3 https://github.com/prometheus/pushgateway/releases/download/v1.4.1/pushgateway-1.4.1.${GOOS}-${GOARCH}.tar.gz
platforms+="${GOOS}/${GOARCH},"
platforms="${GOOS}/${GOARCH},"
cp ../vm/install-${GOOS}.sh ./install.sh
cp ../vm/uninstall-${GOOS}.sh ./uninstall.sh
cp ../vm/prometheus-help.sh ./prometheus-help.sh
cp ../vm/port.properties ./port.properties
cp ../vm/Dockerfile ./Dockerfile
echo "#!/bin/bash" >"run.sh"
echo "" >>"run.sh"
echo "bash install.sh" >>"run.sh"
echo "while ((1))" >>"run.sh"
echo "do" >>"run.sh"
echo " sleep 1" >>"run.sh"
echo "done" >>"run.sh"

docker_repository="polarismesh"
docker_image="polaris-server-standalone"
docker_tag=${SERVER_VERSION}

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 ./
done

platforms=${platforms::-1}
cp ../vm/install-${GOOS}.sh ./install.sh
cp ../vm/uninstall-${GOOS}.sh ./uninstall.sh
cp ../vm/prometheus-help.sh ./prometheus-help.sh
cp ../vm/port.properties ./port.properties
cp ../vm/Dockerfile ./Dockerfile
echo "#!/bin/bash" >"run.sh"
echo "" >>"run.sh"
echo "bash install.sh" >>"run.sh"
echo "while ((1))" >>"run.sh"
echo "do" >>"run.sh"
echo " sleep 1" >>"run.sh"
echo "done" >>"run.sh"
docker_repository="polarismesh"
docker_image="polaris-server-standalone"
docker_tag=${SERVER_VERSION}
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 ./
18 changes: 8 additions & 10 deletions build_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,13 @@ for arch in ${arch_list[@]}; do
fi

mv polaris-server polaris-server-${arch}
platforms+="linux/${arch},"
done

platforms=${platforms::-1}
extra_tags=""
platforms="linux/${arch},"

pre_release=`echo ${docker_tag}|egrep "(alpha|beta|rc|[T|t]est)"|wc -l`
if [ ${pre_release} == 0 ]; then
extra_tags="-t ${docker_repository}/polaris-server:latest"
fi
extra_tags=""
pre_release=`echo ${docker_tag}|egrep "(alpha|beta|rc|[T|t]est)"|wc -l`
if [ ${pre_release} == 0 ]; then
extra_tags="-t ${docker_repository}/polaris-server:latest"
fi

docker buildx build --network=host -t ${docker_repository}/polaris-server:${docker_tag} ${extra_tags} --platform ${platforms} --push ./
docker buildx build --network=host -t ${docker_repository}/polaris-server:${docker_tag} ${extra_tags} --platform ${platforms} --push ./
done

0 comments on commit 2df4ba3

Please sign in to comment.