查询docker容器的状态
systemctl status docker
设置docker开机自启动
systemctl enable docker
查看docker中的详细信息
docker info
docker run -e TZ=Asia/Shanghai your-image和sudo systemctl start docker区别
sudo systemctl stop docker
docker exec -it 27847330b392 bash -c "echo 'Asia/Shanghai' > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata"
docker exec -it 27847330b392 bash -c "timedatectl set-timezone Asia/Shanghai"
docker exec -it 27847330b392 bash -c "ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' > /etc/timezone"
docker exec -it 27847330b392 /bin/sh
ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo Asia/Shanghai > /etc/timezone
exit
docker exec -it 87ce563031e6 /bin/sh
ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo Asia/Shanghai > /etc/timezone
exit
docker exec -it 87ce563031e6 date
docker exec -it 27847330b392 date
timedatectl status
sudo timedatectl set-timezone Asia/Shanghai
docker run --rm alpine date
发表评论