2

Just tried to install docker on my Ubuntu 16.04, and I get the error below. Any suggestions what is wrong and how to fix it?

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 Fri 2017-07-28 12:39:11 CEST; 9ms ago
     Docs: https://docs.docker.com
  Process: 15533 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
 Main PID: 15533 (code=exited, status=1/FAILURE)

Jul 28 12:39:11 jonas-X555LAB systemd[1]: Failed to start Docker Application Container Engine.
Jul 28 12:39:11 jonas-X555LAB systemd[1]: docker.service: Unit entered failed state.
Jul 28 12:39:11 jonas-X555LAB 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-0ubuntu9) ...
Processing triggers for systemd (229-4ubuntu19) ...
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)

I followed this guide: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update

$ sudo apt-cache policy docker-ce
docker-ce:
  Installed: 17.06.0~ce-0~ubuntu
  Candidate: 17.06.0~ce-0~ubuntu
  Version table:
 *** 17.06.0~ce-0~ubuntu 500
        500 https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
        500 https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
        100 /var/lib/dpkg/status
     17.05.0~ce-0~ubuntu-xenial 500
        500 https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
     17.04.0~ce-0~ubuntu-xenial 500
        500 https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
     17.03.2~ce-0~ubuntu-xenial 500
        500 https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
     17.03.1~ce-0~ubuntu-xenial 500
        500 https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
     17.03.0~ce-0~ubuntu-xenial 500
        500 https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages

$ sudo apt-get install -y docker-ce

On this same machine, I have a Linux Mint 17.3 installation on which docker worked just fine. Using same home directory as before on LM17.3.

Here are some specs:

$ inxi -fs
CPU:       Dual core Intel Core i3-4005U (-HT-MCP-) cache: 3072 KB 
           clock speeds: max: 1600 MHz 1: 799 MHz 2: 799 MHz 3: 799 MHz 4: 799 MHz
           CPU Flags: abm acpi aes aperfmperf apic arat arch_perfmon avx avx2 bmi1 bmi2 bts clflush cmov
           constant_tsc cx16 cx8 de ds_cpl dtes64 dtherm dts epb ept erms est f16c flexpriority fma fpu fsgsbase
           fxsr ht invpcid lahf_lm lm mca mce mmx monitor movbe msr mtrr nonstop_tsc nopl nx pae pat pbe pcid
           pclmulqdq pdcm pdpe1gb pebs pge pln pni popcnt pse pse36 pts rdrand rdtscp rep_good sdbg sep smep ss
           sse sse2 sse4_1 sse4_2 ssse3 syscall tm tm2 tpr_shadow tsc tsc_adjust tsc_deadline_timer vme vmx vnmi
           vpid xsave xsaveopt xtopology xtpr
Sensors:   System Temperatures: cpu: 40.5C mobo: N/A
           Fan Speeds (in rpm): cpu: 2800
2

Hi you might want to use journalctl to see exactly what is going wrong.

Use it like this:

# journalctl -u docker.service

To view logs and see what exactly went wrong.

Tip: use the --since flag to filter your search.

For more information on journalctl see this page.

  • Thanks, this seems to have no effect. Btw, this is an Ubuntu 16.04 desktop install with standard Unity DE. And it's a completely fresh install. – ellvtr Jul 31 '17 at 14:02
1

It works now. It appears that docker-ce was installed all along and that it failed because I tried to install it again. Very odd. Normally, if you try to install a package that is already installed, you get something like this:

$ sudo apt install mypackage
Reading package lists... Done
Building dependency tree
Reading state information... Done
mypackage is already the newest version (5.7.19-0ubuntu0.16.04.1).
0 upgraded, 0 newly installed, 0 to remove and 27 not upgraded.

Perhaps the problem was that I had added different repos to /etc/apt/sources.list based on the different tutorials I followed. Embarrassing that I hadn't noticed that the service was running in the background all along and working just fine .. :/

1

Based on this link I used the following steps

  • wipe /var/lib/docker (rm -rf /var/lib/docker) this will remove all existing containers and images.

  • edit /etc/default/docker file and add the option: DOCKER_OPTS="-s overlay"

then

systemctl restart docker.service
0

For me, I get this error.

Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.

Finally, I fixed the error in the /etc/docker/daemon.json by adding a missing comma before registry-mirrors

{
    "runtimes": {
        "nvidia": {
            "path": "/usr/bin/nvidia-container-runtime",
            "runtimeArgs": []
        }
    }    

    # I forget to add a comma , here !!!!!!!
    "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"]
}

After I added the comma and restarted docker with systemctl restart docker, I solved the issue.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.