提交 5abdaa6f 作者: yanxin

容器构建配置修改

上级 da4da3f7
...@@ -18,8 +18,11 @@ COPY --from=builder /workspace/target/*.jar /workspace/app.jar ...@@ -18,8 +18,11 @@ COPY --from=builder /workspace/target/*.jar /workspace/app.jar
ARG ENV_NAME ARG ENV_NAME
ARG PORT ARG PORT
ARG NACOS_SERVER
ARG NACOS_USERNAME
ARG NACOS_PASSWORD
ENV APP_OPTS1="-Dspring.profiles.active=nacos" ENV APP_OPTS1="-Dspring.profiles.active=${ENV_NAME}"
ENV APP_OPTS2="-Djasypt.encryptor.password=1@wdLkj90#chMsdzxA%2024" ENV APP_OPTS2="-Djasypt.encryptor.password=1@wdLkj90#chMsdzxA%2024"
ENV APP_OPTS3="-Dfile.encoding=utf-8" ENV APP_OPTS3="-Dfile.encoding=utf-8"
ENV APP_OPTS4="-Duser.timezone=Asia/Shanghai" ENV APP_OPTS4="-Duser.timezone=Asia/Shanghai"
...@@ -27,9 +30,10 @@ ENV APP_OPTS5="-Dspring.cloud.nacos.discovery.server-addr=${NACOS_SERVER}" ...@@ -27,9 +30,10 @@ ENV APP_OPTS5="-Dspring.cloud.nacos.discovery.server-addr=${NACOS_SERVER}"
ENV APP_OPTS6="-Dspring.cloud.nacos.config.server-addr=${NACOS_SERVER}" ENV APP_OPTS6="-Dspring.cloud.nacos.config.server-addr=${NACOS_SERVER}"
ENV APP_OPTS7="-Dspring.cloud.nacos.config.username=${NACOS_USERNAME}" ENV APP_OPTS7="-Dspring.cloud.nacos.config.username=${NACOS_USERNAME}"
ENV APP_OPTS8="-Dspring.cloud.nacos.config.password=${NACOS_PASSWORD}" ENV APP_OPTS8="-Dspring.cloud.nacos.config.password=${NACOS_PASSWORD}"
ENV APP_OPTS9="-Dserver.port=${PORT}"
ENV JVM_OPTS="-Xmx2024M -Xms256M" ENV JVM_OPTS="-Xmx2024M -Xms256M"
EXPOSE ${PORT} EXPOSE ${PORT}
ENTRYPOINT ["sh","-c","java $JVM_OPTS $APP_OPTS1 $APP_OPTS2 $APP_OPTS3 $APP_OPTS4 -jar /workspace/app.jar"] ENTRYPOINT ["sh","-c","java $JVM_OPTS $APP_OPTS1 $APP_OPTS2 $APP_OPTS3 $APP_OPTS4 $APP_OPTS5 $APP_OPTS6 $APP_OPTS7 $APP_OPTS8 -jar /workspace/app.jar"]
\ No newline at end of file \ No newline at end of file
...@@ -44,7 +44,13 @@ function handle { ...@@ -44,7 +44,13 @@ function handle {
echo "完整镜像: ${domain}/${namespace}/${name}:${version}" echo "完整镜像: ${domain}/${namespace}/${name}:${version}"
echo "---构建镜像---" echo "---构建镜像---"
docker build --build-arg ENV_NAME=${svc_env} --build-arg PORT=${svc_port} -f ./build/Dockerfile -t ${domain}/${namespace}/${name}:${version} . docker build \
--build-arg ENV_NAME=${profiles} \
--build-arg PORT=${svc_port} \
--build-arg NACOS_SERVER=${nacos_server} \
--build-arg NACOS_USERNAME=${nacos_username} \
--build-arg NACOS_PASSWORD=${nacos_password} \
-f ./build/Dockerfile -t ${domain}/${namespace}/${name}:${version} .
echo "---推送镜像---" echo "---推送镜像---"
docker login -u=$username -p=${passwd} ${domain} docker login -u=$username -p=${passwd} ${domain}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论