docker容器启动失败:Error response from daemon: Container xxx is not running

启动容器:

Error response from daemon: Container 0a1dfb5472726f79056202e9d140b6c28189d326fb595a539f7cc151aa0c24c8 is not running

查看日志

$ docker logs 0a1dfb547272

standard_init_linux.go:211: exec user process caused "no such file or directory"

 

 解决方法:

参照https://github.com/yeasy/docker_practice/blob/master/install/ubuntu.md重新安装docker-ce

测试并运行docker run hello-world时,它会出现以下错误:

    WARNING: Error loading config file:/home/user/.docker/config.json - stat /home/user/.docker/config.json: permission denied

    解决方法:

    sudo chown "$USER":"$USER" /home/"$USER"/.docker -R

    sudo chmod g+rwx "/home/$USER/.docker" -R

 

另外如果有需要可以修改docker存储位置:

查看Docker默认存储路径: $ docker info |grep Dir             //var/lib/docker

修改默认存储路径:

关闭docker服务: $ sudo service docker stop

进入 docker.service.d中,docker.service.d 如果没有可自行创建: $ cd etc/systemd/system/docker.service.d

修改 docker-overlay.conf 文件,如果没有可自行创建: $ sudo vim docker-overlay.conf

在文本中添加

[Service]

ExecStart=

ExecStart =/usr/bin/dockerd --graph="/usr/work/app/docker" --storage-driver=overlay

重启docker

$ systemctl daemon-reload

$ sudo service docker start

你可能感兴趣的:(ubuntu,docker)