在ubuntu 16.04中安装docker时出错

时间:2018-05-23 12:22:34

标签: ubuntu docker ubuntu-16.04

我在Ubuntu 16.04上安装Docker CE时遇到此错误:

 >  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 2018-05-23 17:49:42 IST; 3ms ago
    >      Docs: https://docs.docker.com   Process: 9708 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE) 
    > Main PID: 9708 (code=exited, status=1/FAILURE)
    > 
    > May 23 17:49:42 HMECD001209 systemd[1]: Failed to start Docker
    > Application Container Engine. May 23 17:49:42 HMECD001209 systemd[1]:
    > docker.service: Unit entered failed state. May 23 17:49:42 HMECD001209
    > systemd[1]: docker.service: Failed with result 'exit-code'. dpkg:
    > error processing package docker-ce (--configure):  subprocess
    > installed post-installation script returned error exit status 1
    > Processing triggers for libc-bin (2.23-0ubuntu10) ... Processing
    > triggers for systemd (229-4ubuntu21.2) ... Processing triggers for
    > ureadahead (0.100.0-19) ... Errors were encountered while processing: 
    > docker-ce E: Sub-process /usr/bin/dpkg returned an error code (1)

有什么建议吗?

2 个答案:

答案 0 :(得分:1)

sudo nano /etc/docker/daemon.json 加上这个, {     “存储驱动程序”:“overlay2” } 编辑这个, sudo nano / etc / default / docker 加上这个。 DOCKER_OPTS =“ - s overlay” 然后sudo systemctl daemon-reload sudo systemctl重启docker,它会工作。

答案 1 :(得分:0)

根据docker官方安装指南,有三种方法可以在ubuntu上安装docker ce:

  1. 使用存储库安装
  2. 安装DOCKER CE
  3. 从软件包安装
  4. 参考。 https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-using-the-repository

    建议:首先在Ubuntu上轻松安装docker ce,只需确保安装最新的稳定版本而不是edge,直到您对edge有特定要求。 请不要忘记在开始之前阅读官方安装指南。