1、文档链接:

2、知识点

2.1、docker命令自动补全

  1. yum install -y bash-completion
  2. source /usr/share/bash-completion/completions/docker
  3. source /usr/share/bash-completion/bash_completion

2.2、overlay 挂载

  1. mount -t overlay overlay -olowerdir=/var /lib/docker/overlay/8a34297c208159693af91a8922bf6e3c5ea8ce17e21dd5aae55d67b09578e66e/root,upperdir=./upper,workdir=./work
  2. ./merged
  3. mount -t overlay overlay -olowerdir=./low,upperdir=./upper,workdir=./work ./merged

2.3、配置代理

# 创建目录
mkdir -p /etc/systemd/system/docker.service.d
# 创建文件

  1. sudo tee /etc/systemd/system/docker.service.d/http-proxy.conf <<-'EOF'
  2. [Service]
  3. Environment="HTTPS_PROXY=http://proxy.example.com:80/"
  4. EOF

#重启
sudo systemctl daemon-reload
sudo systemctl restart docker

2.4.配置镜像仓库

配置阿里云镜像

  1. #您可以通过修改daemon配置文件/etc/docker/daemon.json来使用加速器
  2. sudo mkdir -p /etc/docker
  3. sudo tee /etc/docker/daemon.json <<-'EOF'
  4. {
  5. "registry-mirrors": ["https://3gqts388.mirror.aliyuncs.com"]
  6. }
  7. EOF
  8. # 重启
  9. sudo systemctl daemon-reload
  10. sudo systemctl restart docker