Using docker to install jenkins and link gitlab timeout

The jenkins installed using docker
worked fine on the first day. On the second day, I found that it could not connect to gitlab.
All the verification information was correct.
Insert image description here
Later I found out that it was a time issue with jenkins.
After entering jenkins, I used the date command to find out. It is UTC time.
Solution:
When starting the container, map the local location of the server to the container
-v /etc/localtime:/etc/localtime

docker run -d --name jenkins -p 8081:8080 -p 50000:50000 -v /home/data/jenkins_data:/var/jenkins_home -v /etc/localtime:/etc/localtime  jenkins/jenkins

Guess you like

Origin blog.csdn.net/weixin_44931584/article/details/130746362