Docker는 서비스로 구성할 수 없습니다.
docker를 설치한 후 docker info, docker version 등 어떤 docker 명령에서도 응답이 없습니다.
패키지에서 docker ce와 해당 구성 요소를 설치했습니다.
sudo dpkg -i containerd.io_1.2.4-1
docker-ce_18.09.9~3-0~ubuntu-bionic_amd64.deb
docker-ce-cli_18.09.9~3-0~ubuntu-bionic_amd64.deb
이어서
sudo systemctl enable docker.service
sudo systemctl enable containerd.service
docker.service는 /etc/systemd/system/multi-user.target.wants 아래에 있습니다.
BindsTo=containerd.service
After=network-online.target firewalld.service containerd.service
Wants=network-online.target
Requires=docker.socket
[Service]
Type=notify
EnvironmentFile=-/etc/default/docker
ExecStart=/usr/bin/docker daemon $DOCKER_OPTS -H fd:// --containerd=/run/containerd/containerd.sock
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=0
RestartSec=2
Restart=always
StartLimitBurst=3
StartLimitInterval=60s
LimitNOFILE=1048576
LimitNPROC=1048576
LimitCORE=1048576
TasksMax=infinity
Delegate=yes
KillMode=process
[Install]
WantedBy=multi-user.target
/etc/default/docker 내용:
export http_proxy="http://proxy.com:80/"
export https_proxy="http://proxy.com:80/"
export NO_PROXY="localhost,127.0.0.1,.example.com"
export no_proxy=$NO_PROXY
DOCKER_OPTS="--dns <dns server> --dns <dns server> -H tcp://0.0.0.0:4321 -H unix:///var/run/docker.sock --storage-driver=devicemapper --storage-opt dm.datadev=/dev/vg-docker/data
--storage-opt dm.metadatadev=/dev/vg-docker/metadata --storage-opt dm.basesize=100G"
상태를 확인하면 다음 메시지와 함께 중단됩니다.
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: activating (start) since Mon 2021-04-26 08:48:55 PDT; 2min 2s ago
Docs: https://docs.docker.com
Main PID: 21021 (docker)
Tasks: 17
CGroup: /system.slice/docker.service
└─21021 /usr/bin/docker daemon --dns 171.40.110.110 --dns 171.40.110.111 -H tcp://0.0.0.0:4321 -H unix:///var/run/docker.sock --storage-driver=devicemapper -
systemd[1]: Starting Docker Application Container Engine...
운영 체제: 우분투 18.04