Skip to content

Commit fc459e8

Browse files
committed
tomcat
1 parent a45e52e commit fc459e8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

markdown-file/Jenkins-Install-And-Settings.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ pipeline {
549549
inDockerAndJavaPort = "8081"
550550
inHostLogPath = "/data/docker/logs/${dockerContainerName}/${env.BUILD_NUMBER}"
551551
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}"
553553
}
554554
555555
/*=======================================常修改变量-end=======================================*/
@@ -673,7 +673,7 @@ pipeline {
673673
inDockerAndJavaPort = "8081"
674674
inHostLogPath = "/data/docker/logs/${dockerContainerName}/${env.BUILD_NUMBER}"
675675
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}"
677677
}
678678
679679
/*=======================================常修改变量-end=======================================*/
@@ -754,6 +754,8 @@ pipeline {
754754
sh """
755755
docker -H ${projectDockerDaemon} pull ${dockerImageName}
756756
757+
docker -H ${projectDockerDaemon} stop ${dockerContainerName} | true
758+
757759
docker -H ${projectDockerDaemon} rm -f ${dockerContainerName} | true
758760
759761
docker -H ${projectDockerDaemon} run -d ${dockerRunParam} ${dockerImageName}

0 commit comments

Comments
 (0)