在Ubuntu 16.04上安装docker-ce时,子进程/ usr / bin / dpkg返回错误代码(1)

时间:2018-11-13 17:40:20

标签: docker ubuntu vagrant ubuntu-16.04

我尝试通过脚本自动准备Ubuntu 16.04来安装Rancher,它需要17.03.2作为最新的Docker版本:

 default: Setting up docker-ce (17.03.2~ce-0~ubuntu-xenial) ...
    default: Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
    default: invoke-rc.d: initscript docker, action "start" failed.
    default: ● docker.service - Docker Application Container Engine
    default:    Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
    default:    Active: failed (Result: exit-code) since Tue 2018-11-13 17:25:47 UTC; 6ms ago
    default:      Docs: https://docs.docker.com
    default:   Process: 4162 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
    default:  Main PID: 4162 (code=exited, status=1/FAILURE)
    default: Nov 13 17:25:47 ubuntu-xenial systemd[1]: Starting Docker Application Contai....
    default: Nov 13 17:25:47 ubuntu-xenial dockerd[4162]: no sockets found via socket act...d
    default: Nov 13 17:25:47 ubuntu-xenial systemd[1]: docker.service: Main process exite...E
    default: Nov 13 17:25:47 ubuntu-xenial systemd[1]: Failed to start Docker Application....
    default: Nov 13 17:25:47 ubuntu-xenial systemd[1]: docker.service: Unit entered faile....
    default: Nov 13 17:25:47 ubuntu-xenial systemd[1]: docker.service: Failed with result....
    default: Hint: Some lines were ellipsized, use -l to show in full.
    default: dpkg: error processing package docker-ce (--configure):
    default:  subprocess installed post-installation script returned error exit status 1
    default: Processing triggers for libc-bin (2.23-0ubuntu10) ...
    default: Processing triggers for systemd (229-4ubuntu21.8) ...
    default: Processing triggers for ureadahead (0.100.0-19) ...
    default: Errors were encountered while processing:
    default:  docker-ce
    default: E: Sub-process /usr/bin/dpkg returned an error code (1)

根据Docker docs的脚本:

apt-get update
apt-get upgrade -y
apt-get remove -y docker docker-engine docker.io

apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

apt-get update
apt-get install -y docker-ce=17.03.2~ce-0~ubuntu-xenial

似乎Docker本身在工作,因为我可以用docker --version启动守护程序后,调用service docker start。但是我不知道为什么会发生这些错误。

Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/xenial64"

   config.vm.provision "shell", path: "scripts/dependencies.sh"
end

我正在将Vagrant与vagrant up --provision一起使用。在开始之前,使用vagrant destroy删除了旧计算机,以确保问题不是由某些较旧的脚本运行引起的。版本是16.04.5 LTSsystemctljournalctl命令给了我很长的输出,似乎没有更多有关该问题的信息,例如

  

默认值:11月13日17:41:19 ubuntu-xenial systemd [1]:docker.service:主进程已退出,代码已退出,状态= 1 /失败

更奇怪的是,我在运行vagrant ssh并手动执行所有命令时没有得到错误。

0 个答案:

没有答案