6- jenkins learning time into docker container modification jenkins

Foreword

Jenkins with docker built environment and our local display time difference in time 8 hours, the time required to modify the system inside the container

View time

First check the host's system time

date -R

Into the docker container to view time

docker exec -it -u root 容器id /bin/bash

Inconsistent view inside the container system time with the host

date -R

Check system zone inside the container, shows the Etc / UTC

root@cb8e397d5308:/# cat /etc/timezone
Etc/UTC

Modifying Containers time

Inside the container to create Asia time zone file

echo Asia/Shanghai >/etc/timezone

localtime can be copied from the host into the container (exit to exit the container, operating on the host docker cp)

docker cp /usr/share/zoneinfo/Asia/Shanghai 容器id:/etc/localtime

Check the time on the show can be a normal Jenkins

Guess you like

Origin www.cnblogs.com/yoyoketang/p/12130791.html