21 lines
610 B
Bash
Executable File
21 lines
610 B
Bash
Executable File
#!/bin/bash
|
|
|
|
tag=$(date +'%Y%m%d%H%M')
|
|
image=172.20.32.159/pipeline-service/remote-task-cli:${tag}
|
|
|
|
# 从环境变量读取 Nacos 配置,如果没有则使用默认值
|
|
NACOS_HOST=${NACOS_HOST:-172.20.32.121}
|
|
NACOS_PORT=${NACOS_PORT:-31203}
|
|
|
|
echo "构建镜像,使用 Nacos 配置: Host=${NACOS_HOST}, Port=${NACOS_PORT}"
|
|
|
|
docker build \
|
|
--build-arg NACOS_HOST=${NACOS_HOST} \
|
|
--build-arg NACOS_PORT=${NACOS_PORT} \
|
|
-t ${image} .
|
|
|
|
docker push ${image}
|
|
|
|
docker tag ${image} ccr.ccs.tencentyun.com/somunslotus/remote-task-cli:${tag}
|
|
docker push ccr.ccs.tencentyun.com/somunslotus/remote-task-cli:${tag}
|