File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -549,7 +549,7 @@ pipeline {
549
549
inDockerAndJavaPort = "8081"
550
550
inHostLogPath = "/data/docker/logs/${dockerContainerName}/${env.BUILD_NUMBER}"
551
551
inDockerLogPath = "/data/logs"
552
- dockerRunParam = "--name ${dockerContainerName} -v /etc/hosts:/etc/hosts -v ${inHostLogPath}:${inDockerLogPath} --restart=always -p ${inHostPort}:${inDockerAndJavaPort}"
552
+ dockerRunParam = "--name=${dockerContainerName} --hostname= ${dockerContainerName} -v /etc/hosts:/etc/hosts -v ${inHostLogPath}:${inDockerLogPath} --restart=always -p ${inHostPort}:${inDockerAndJavaPort}"
553
553
}
554
554
555
555
/*=======================================常修改变量-end=======================================*/
@@ -673,7 +673,7 @@ pipeline {
673
673
inDockerAndJavaPort = "8081"
674
674
inHostLogPath = "/data/docker/logs/${dockerContainerName}/${env.BUILD_NUMBER}"
675
675
inDockerLogPath = "/data/logs"
676
- dockerRunParam = "--name ${dockerContainerName} -v /etc/hosts:/etc/hosts -v ${inHostLogPath}:${inDockerLogPath} --restart=always -p ${inHostPort}:${inDockerAndJavaPort}"
676
+ dockerRunParam = "--name=${dockerContainerName} --hostname= ${dockerContainerName} -v /etc/hosts:/etc/hosts -v ${inHostLogPath}:${inDockerLogPath} --restart=always -p ${inHostPort}:${inDockerAndJavaPort}"
677
677
}
678
678
679
679
/*=======================================常修改变量-end=======================================*/
@@ -754,6 +754,8 @@ pipeline {
754
754
sh """
755
755
docker -H ${projectDockerDaemon} pull ${dockerImageName}
756
756
757
+ docker -H ${projectDockerDaemon} stop ${dockerContainerName} | true
758
+
757
759
docker -H ${projectDockerDaemon} rm -f ${dockerContainerName} | true
758
760
759
761
docker -H ${projectDockerDaemon} run -d ${dockerRunParam} ${dockerImageName}
You can’t perform that action at this time.
0 commit comments