moby: Install script fails in raspberry pi 3

Description

When trying to install docker on raspbian in a raspberry pi 3, docker-engine fails.

Steps to reproduce the issue:

  1. curl -sSL get.docker.com | sh

Describe the results you received:

The following extra packages will be installed:
  cgroupfs-mount
The following NEW packages will be installed:
  cgroupfs-mount docker-engine
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/16.5 MB of archives.
After this operation, 78.4 MB of additional disk space will be used.
Selecting previously unselected package cgroupfs-mount.
(Reading database ... 109643 files and directories currently installed.)
Preparing to unpack .../cgroupfs-mount_1.1_all.deb ...
Unpacking cgroupfs-mount (1.1) ...
Selecting previously unselected package docker-engine.
Preparing to unpack .../docker-engine_1.13.1-0~raspbian-jessie_armhf.deb ...
Unpacking docker-engine (1.13.1-0~raspbian-jessie) ...
Processing triggers for systemd (215-17+deb8u6) ...
Processing triggers for man-db (2.7.0.2-5) ...
Setting up cgroupfs-mount (1.1) ...
Setting up docker-engine (1.13.1-0~raspbian-jessie) ...
Job for docker.service failed. See 'systemctl status docker.service' and 'journalctl -xn' for details.
invoke-rc.d: initscript docker, action "start" failed.
dpkg: error processing package docker-engine (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 docker-engine
E: Sub-process /usr/bin/dpkg returned an error code (1)

uname -a Linux raspberrypi 4.4.38-v7+ #938 SMP Thu Dec 15 15:22:21 GMT 2016 armv7l GNU/Linux

Output of docker version:

Client:
 Version:      1.13.1
 API version:  1.26
 Go version:   go1.7.5
 Git commit:   092cba3
 Built:        Wed Feb  8 07:25:30 2017
 OS/Arch:      linux/arm
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Output of docker info:

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 10
  • Comments: 25 (8 by maintainers)

Most upvoted comments

Just for info, I just got this, clean install of Raspbian Jessie Lite, ran apt-get update && apt-get upgrade then curl -sSL https://get.docker.com | sh but got the same error as OP.

Simple reboot then sudo apt-get install -y -q docker-engine fixed the issue.

Got a same error in rpi3 Raspbian, thanks to this post.

  1. Uninstall docker following how-to-remove-docker-installed-using-wget
  2. Reboot
  3. Re-run curl -sSL https://get.docker.com | sh

I got this working, and I believe the issue may have arisen because of incomplete removal of one of my earlier attempts at installing docker. Viewing the systemd boot script actually didn’t yield anything useful. After googling for systemd and docker, I found this post: https://bbs.archlinux.org/viewtopic.php?id=194087

Long story short, the steps to uninstall a previous version of docker are:

  • stop the docker service
  • sudo apt-get purge -y docker-engine (this uninstalls the entire package AND removes all configuration files) sudo apt-get autoremove (remove previously installed dependencies that are no longer used)
  • <reboot> (Critical step!)
  • sudo rm -Rf /var/lib/docker (I believe this was the key)
  • reinstall docker with sudo curl -sSL https://get.docker.com | sh

I believe fully removing /var/lib/docker/ was the key because it was the one step I had never performed before. If I attempted to remove this directory prior to a reboot, I received an error that /var/lib/docker/overlay2 was in use and could not be deleted. After the system reboot, the rm command was successful. Running the install as normal was then successful right away.

I hope this helps others. Thanks for your patience and help. You may mark this issue as closed again.

Regards, Dean Powell Edmonton, Canada

Thanks for your responses, after a clean install docker works fine.

@abrahamduran I can confirm that the same happened to me as well. Rebooting and running the script did it though.

I got the same issue. The convenience script failed without installing docker-ce. As suggested, a reboot and then running sudo apt-get install -y -q docker-ce did the trick for me.

@alexellis perhaps this is something that could be added to the documentation since it is still happening.

It happened to me in:

Raspberry Pi 4
Operating System: Raspbian GNU/Linux 10 (buster)
Kernel: Linux 5.4.51-v7l+
Architecture: arm

It is also a fresh install. The only things that ran before the convenience script were apt update and apt upgrade.