docker - daemon.json不能为空

docker 初次安装时,手欠,加了 /etc/docker/daemon.json 却没有写入内容,重启 docker 及执行其他命令时报错:

dev@java-master:/var/lib/dpkg$ sudo apt remove 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up docker-ce (5:19.03.12~3-0~ubuntu-focal) ...
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
invoke-rc.d: initscript docker, action "start" failed.
● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Wed 2020-07-22 16:38:34 CST; 6ms ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
    Process: 6676 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (c
ode=exited, status=1/FAILURE)
   Main PID: 6676 (code=exited, status=1/FAILURE)
dpkg: error processing package docker-ce (--configure):
 installed docker-ce package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 docker-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)

只需要删除其配置文件/etc/docker/daemon.json 或者写入 空 json 对象 {} 即可

  • https://www.cnblogs.com/bymo/p/9046586.html
  • http://yanue.net/post-123.html