基本参数配置

1
2
3
4
5
6
7
8
9
10
11
12
13
{
"graph": "/data/docker",
"storage-driver": "overlay2",
"insecure-registries": ["harbor.od.com"],
"registry-mirrors": ["https://xxxxx.mirror.aliyuncs.com"],
"bip": "172.7.2.1/24",
"exec-opts": ["native.cgroupdriver=systemd"],
"live-restore": true
}

重读配置文件
[root@ceshi-132 ~]# sysmtectl daemon-reload
[root@ceshi-132 ~]# systemctl restart docker

传送门官方daemon配置详解

参数 含义
graph docker 将在该文件系统下创建自己的数据集(默认 /var/lib/docker)
storage-driver 守护进程存储驱动程序(overlay2使用相同的快速联合文件系统)
insecure-registries 不安全的仓库
registry-mirrors 设置国内加速仓库地址
bip 类似于docker0作用,ip资源池,为容器分配IP(网桥)
exec-opts systemd和cgroupfs都是CGroup管理器,而systemd是大多数Linux发行版原生的
live-restore 在守护进程停机期间使容器保持活动状态