1 如果你想使用 /etc/default/docker文件配置你的docker 在 /etc/systemd/system/docker.service.d/docker.conf 添加下面
----------------
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H fd:// $DOCKER_OPTS
EnvironmentFile=-/etc/default/docker
-------------------------------------------------------
2 然后你可以创建/etc/default/docker文件.并在里面添加下面
DOCKER_OPTS="--label=name=docker_server_1"
或
DOCKER_OPTS=" --label name=abc"
3 查看
sudo docker info
..略
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
name=docker_server_1
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false