1、文档链接:
2、知识点
2.1、docker命令自动补全
yum install -y bash-completion
source /usr/share/bash-completion/completions/docker
source /usr/share/bash-completion/bash_completion
2.2、overlay 挂载
mount -t overlay overlay -olowerdir=/var /lib/docker/overlay/8a34297c208159693af91a8922bf6e3c5ea8ce17e21dd5aae55d67b09578e66e/root,upperdir=./upper,workdir=./work
./merged
mount -t overlay overlay -olowerdir=./low,upperdir=./upper,workdir=./work ./merged
2.3、配置代理
# 创建目录mkdir -p /etc/systemd/system/docker.service.d
# 创建文件
sudo tee /etc/systemd/system/docker.service.d/http-proxy.conf <<-'EOF'
[Service]
Environment="HTTPS_PROXY=http://proxy.example.com:80/"
EOF
#重启sudo systemctl daemon-reload
sudo systemctl restart docker
2.4.配置镜像仓库
配置阿里云镜像
#您可以通过修改daemon配置文件/etc/docker/daemon.json来使用加速器
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://3gqts388.mirror.aliyuncs.com"]
}
EOF
# 重启
sudo systemctl daemon-reload
sudo systemctl restart docker