Docker 存储,时区,镜像加速等配置问题 (Redhat)
配置存储,加速
vim /etc/docker/daemon.json { "registry-mirrors": ["https://90sc1jac.mirror.aliyuncs.com"], "storage-driver": "overlay" }
修改数据文件默认存储位置
$ systemclt stop docker.service $ mv /var/lib/docker /data/docker $ ln -s /data/docker /var/lib/docker $ systemctl start docker.service
时区问题
Dockerfile
#时间,时区问题 RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ && echo "Asia/shanghai" > /etc/timezone
挂载主机 localtime
$ docker run --name <name> -v /etc/localtime:/etc/localtime:ro ...
容器与宿主机之间文件传输
$ docker cp <containerId>:/file/path/within/container /host/path/target
导出镜像
$ sudo docker save busybox-1 > /home/save.tar
导出容器
$ sudo docker export <CONTAINER ID> > /home/export.tar
导入镜像
$ docker load < /home/save.tar
相关推荐
王道革 2020-11-25
魅惑青花瓷 2020-11-11
lihongtai 2020-11-09
TaoTaoFu 2020-11-06
liaochaowu 2020-11-16
ChlatZed 2020-11-11
xysoul 2020-11-03
changecan 2020-09-22
newisI 2020-09-01
链块学院 2020-09-09
lihy0 2020-09-07
fearlessxjdx 2020-09-04
ChlatZed 2020-08-23
bwyyziq 2020-11-22
pigsmall 2020-11-19
changecan 2020-11-19
helloWorldAndYou 2020-11-16
nginxs 2020-11-14
红石丶 2020-11-13