更新客户端Dockerfile
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
FROM openjdk:8-jdk-alpine
|
||||
FROM openjdk:17-jdk-alpine
|
||||
#同步时间
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
|
||||
apk update && apk add wget unzip vim && apk add -U tzdata && \
|
||||
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
|
||||
RUN mkdir -p /root/neutrino-proxy/config
|
||||
WORKDIR /root/neutrino-proxy
|
||||
COPY ../neutrino-proxy-client/target/neutrino-proxy-client.jar /root/neutrino-proxy/neutrino-proxy-client.jar
|
||||
COPY ../neutrino-proxy-client/src/main/resources/app.yml /root/neutrino-proxy/config
|
||||
COPY ./target/neutrino-proxy-client.jar /root/neutrino-proxy/neutrino-proxy-client.jar
|
||||
COPY ./src/main/resources/app.yml /root/neutrino-proxy/config
|
||||
#VOLUME ["/root/neutrino-proxy"]
|
||||
ENTRYPOINT ["java","-jar","neutrino-proxy-client.jar","config=./config/app.yml"]
|
||||
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
#!/bin/sh
|
||||
|
||||
# 镜像版本,每次更新版本时需要调整
|
||||
ImageVer=1.8.5
|
||||
ImageVer=2.0.0
|
||||
ImageName=neutrino-proxy-client
|
||||
DockerFilePath=$PWD/../../neutrino-proxy-client/Dockerfile
|
||||
DockerFilePath=$PWD/../../neutrino-proxy-client
|
||||
|
||||
deployDir=$PWD/../../"deploy"
|
||||
clientDeployDir=$deployDir"/client"
|
||||
|
||||
#切到项目根目录
|
||||
#初始化文件夹
|
||||
if [ ! -d "$deployDir" ];then
|
||||
mkdir $deployDir
|
||||
fi
|
||||
if [ ! -d "$clientDeployDir" ];then
|
||||
mkdir $clientDeployDir
|
||||
fi
|
||||
rm -rf $clientDeployDir/$ImageName.tar
|
||||
##初始化文件夹
|
||||
#deployDir=$PWD/../../"deploy"
|
||||
#clientDeployDir=$deployDir"/client"
|
||||
#if [ ! -d "$deployDir" ];then
|
||||
# mkdir $deployDir
|
||||
#fi
|
||||
#if [ ! -d "$clientDeployDir" ];then
|
||||
# mkdir $clientDeployDir
|
||||
#fi
|
||||
#rm -rf $clientDeployDir/$ImageName.tar
|
||||
|
||||
#echo '打包jar...'
|
||||
sh ./client_build.sh
|
||||
#sh ./client_build.sh
|
||||
|
||||
# 删除老的本地镜像
|
||||
docker rmi -f $(docker images | grep $ImageName | awk '{print $3}')
|
||||
# 构建镜像
|
||||
docker build -t $ImageName:$ImageVer -t $ImageName:latest -f $DockerFilePath $PWD/../..
|
||||
docker build -t $ImageName:$ImageVer -t $ImageName:latest $DockerFilePath
|
||||
# 保存镜像到本地
|
||||
docker save -o $clientDeployDir/$ImageName.tar $ImageName:$ImageVer
|
||||
#docker save -o $clientDeployDir/$ImageName.tar $ImageName:$ImageVer
|
||||
|
||||
# docker run -it -e LICENSE_KEY=b0a907332b474b25897c4dcb31fc7eb6 -e SERVER_IP=host.docker.internal --name np-client neutrino-proxy-client:2.0.0
|
||||
|
||||
@@ -5,13 +5,14 @@ ImageVer=2.0.0
|
||||
ImageName=neutrino-proxy
|
||||
DockerFilePath=$PWD/../../neutrino-proxy-server
|
||||
|
||||
##echo '打包管理后台...'
|
||||
#sh ./admin_build_docker.sh
|
||||
##echo '打包jar...'
|
||||
#sh ./server_build.sh
|
||||
#echo '打包管理后台...'
|
||||
sh ./admin_build_docker.sh
|
||||
#echo '打包jar...'
|
||||
sh ./server_build.sh
|
||||
|
||||
# 删除老的本地镜像
|
||||
docker rmi -f $(docker images | grep $ImageName | awk '{print $3}')
|
||||
# 构建镜像
|
||||
docker build -t $ImageName:$ImageVer -t $ImageName:latest $DockerFilePath
|
||||
|
||||
# docker run -it -p 9000-9200:9000-9200/tcp -p 8888:8888 --name np-server neutrino-proxy:2.0.0
|
||||
|
||||
Reference in New Issue
Block a user