Add support to install Docker on raspbian/jessie #24815

Merged
merged 3 commits into from Aug 10, 2016

Conversation

Projects
None yet
9 participants
@DieterReuter
Contributor

DieterReuter commented Jul 19, 2016

- What I did
Adding support in install.sh to install the Docker Engine on a standard Raspberry Pi running a raspbian/jessie OS. Implements docker#24561.

- How I did it
I just added the detection of the Raspbian OS in install.sh and select the correct osname. Since Raspbian has to support ARMv6 and ARMv7 we have to use raspbian/jessie instead of debian/jessie to classify the OS the right way.

$ cat /etc/apt/sources.list.d/docker.list
deb [arch=armhf] https://apt.dockerproject.org/repo raspbian-jessie testing

- How to verify it
Once the new Debian packages for raspbian/jessie are available in the standard Docker APT repository, you can easily test the installation process on a freshly installed Raspberry Pi. First download the Raspbian SD image from https://www.raspberrypi.org/downloads/raspbian/ and select RASPBIAN JESSIE (Desktop version) 2016-05-27-raspbian-jessie.zip or RASPBIAN JESSIE LITE (Server version) 2016-05-27-raspbian-jessie-lite.zip, flash a SD card with it and boot the Raspberry Pi.

Login to the Raspberry Pi with username=pi and password=raspberry, get the script install.sh and start the installation process:

$ repo=testing ./install.sh

Note: repo can be set to main, testing or experimental which basically selects the APT repo branch. For repo=testing the Debian package docker-engine will be fetched from 'https://apt.dockerproject.org/repo/dists/raspbian-jessie/testing/binary-armhf/'.

- Tested on a RASPBIAN JESSIE 2016-05-27-raspbian-jessie.zip with Docker 1.12.0-rc4
Edit: new output with overlay fs

pi@raspberrypi:~ $ sudo docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 1.12.0-rc4
Storage Driver: overlay
 Backing Filesystem: extfs
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: null bridge host overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options:
Kernel Version: 4.4.11-v7+
Operating System: Raspbian GNU/Linux 8 (jessie)
OSType: linux
Architecture: armv7l
CPUs: 4
Total Memory: 925.5 MiB
Name: raspberrypi
ID: SELH:KXHE:UXRL:FX5Z:ATGK:GFGM:6NIG:DFUO:4QQK:3P74:J7XE:BZVS
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
WARNING: No kernel memory limit support
WARNING: No cpu cfs quota support
WARNING: No cpu cfs period support
WARNING: No cpuset support
Insecure Registries:
 127.0.0.0/8
pi@raspberrypi:~ $

- Known Issues
The Raspbian Linux kernel supports overlay filesystem by default and this should be the preferred storage driver to run Docker. Right now, the Docker Engine will be installed and is configured to use devmapper. As soon as we can configure options for dockerd -s overlay or --storage-driver overlay during the installation, we can easily switch to use overlay fs. This setting can be made in /lib/systemd/system/docker.service or /etc/systemd/system/docker.service, just modify the line
ExecStart=/usr/bin/dockerd -H fd:// to ExecStart=/usr/bin/dockerd --storage-driver overlay -H fd://.
Edit: this issue is fixed now, overlay is now used as default. I just deployed a Raspbian specific /etc/systemd/system/docker.service file.

- Description for the changelog

Add feature to install the Docker Engine on a Raspberry Pi directly from http://get.docker.com.

- A picture of a cute animal (not mandatory but encouraged)

Signed-off-by: Dieter Reuter dieter.reuter@me.com

Add support to install Docker on raspbian/jessie
Signed-off-by: Dieter Reuter <dieter.reuter@me.com>
@thaJeztah

This comment has been minimized.

Show comment
Hide comment
@thaJeztah

thaJeztah Jul 19, 2016

Member

Perhaps even overlay2? Would it make sense to add a daemon.json with default settings for Raspbian?

Member

thaJeztah commented Jul 19, 2016

Perhaps even overlay2? Would it make sense to add a daemon.json with default settings for Raspbian?

@thaJeztah thaJeztah added this to the 1.12.0 milestone Jul 19, 2016

@icecrime

This comment has been minimized.

Show comment
Hide comment
@icecrime

icecrime Jul 19, 2016

Contributor

I'm also in favor of having a better default than devicemapper:

  • Either by dropping a specific systemd unit file or docker configuration to use overlay
  • Or maybe by having the install script install aufs and rely on the priority list to use that one over devicemapper?
Contributor

icecrime commented Jul 19, 2016

I'm also in favor of having a better default than devicemapper:

  • Either by dropping a specific systemd unit file or docker configuration to use overlay
  • Or maybe by having the install script install aufs and rely on the priority list to use that one over devicemapper?
@DieterReuter

This comment has been minimized.

Show comment
Hide comment
@DieterReuter

DieterReuter Jul 19, 2016

Contributor

What would be the best way to configure overlay by default? I'm not sure if a daemon.json is the right approach since it could break a later usage with docker-machine (we had already tested this a few months ago).

Contributor

DieterReuter commented Jul 19, 2016

What would be the best way to configure overlay by default? I'm not sure if a daemon.json is the right approach since it could break a later usage with docker-machine (we had already tested this a few months ago).

@DieterReuter

This comment has been minimized.

Show comment
Hide comment
@DieterReuter

DieterReuter Jul 19, 2016

Contributor

@icecrime dropping a Raspbian specific systemd unit file to /etc/systemd/system/docker.service can be done easily before the docker-engine package will be installed. Then it will be automatically used. But I really don't like to place this file inline into the install.sh. Do we have a good place in the repo to store such OS specific files and then just curl/wget them on install time?

Or we just curl/wget the default systemd unit file and sed it, just an idea. Like this style:

$ mkdir -p /etc/systemd/system
$ curl -sSL -O /etc/systemd/system/docker.service https://raw.githubusercontent.com/docker/docker/master/contrib/init/systemd/docker.service
$ sed -i 's/dockerd/dockerd --storage-driver overlay/' /etc/systemd/system/docker.service

Maybe I'll try this approach for a short test run. Edit: done with this commit 84ff895, and it works great.

Contributor

DieterReuter commented Jul 19, 2016

@icecrime dropping a Raspbian specific systemd unit file to /etc/systemd/system/docker.service can be done easily before the docker-engine package will be installed. Then it will be automatically used. But I really don't like to place this file inline into the install.sh. Do we have a good place in the repo to store such OS specific files and then just curl/wget them on install time?

Or we just curl/wget the default systemd unit file and sed it, just an idea. Like this style:

$ mkdir -p /etc/systemd/system
$ curl -sSL -O /etc/systemd/system/docker.service https://raw.githubusercontent.com/docker/docker/master/contrib/init/systemd/docker.service
$ sed -i 's/dockerd/dockerd --storage-driver overlay/' /etc/systemd/system/docker.service

Maybe I'll try this approach for a short test run. Edit: done with this commit 84ff895, and it works great.

@tiborvass tiborvass self-assigned this Jul 19, 2016

@tiborvass

This comment has been minimized.

Show comment
Hide comment
@tiborvass

tiborvass Jul 19, 2016

Collaborator

@DieterReuter How can I test if I dont have a Rpi handy? (I have one on the east coast but I'm on the west coast right now)

Collaborator

tiborvass commented Jul 19, 2016

@DieterReuter How can I test if I dont have a Rpi handy? (I have one on the east coast but I'm on the west coast right now)

@DieterReuter

This comment has been minimized.

Show comment
Hide comment
@DieterReuter

DieterReuter Jul 19, 2016

Contributor

@tiborvass hmm, then you're out of luck. ;)

But it doesn't work right now completely without having the .deb packages in the repo. I just simulated everything locally on a RPi and installed the .deb package the following way:

$ repo=testing ./install.sh
$ wget  https://jenkins.hypriot.com/job/armhf-docker/17/artifact/bundles/latest/build-deb/raspbian-jessie/docker-engine_1.12.0%7Erc4-0%7Ejessie_armhf.deb
$ sudo apt-get install -y libapparmor1
$ sudo dpkg -i docker-engine_1.12.0~rc4-0~jessie_armhf.deb

That's exactly the reason why I'd like to have the .deb package in testing on the Docker APT repo. See #24561 (comment).

Contributor

DieterReuter commented Jul 19, 2016

@tiborvass hmm, then you're out of luck. ;)

But it doesn't work right now completely without having the .deb packages in the repo. I just simulated everything locally on a RPi and installed the .deb package the following way:

$ repo=testing ./install.sh
$ wget  https://jenkins.hypriot.com/job/armhf-docker/17/artifact/bundles/latest/build-deb/raspbian-jessie/docker-engine_1.12.0%7Erc4-0%7Ejessie_armhf.deb
$ sudo apt-get install -y libapparmor1
$ sudo dpkg -i docker-engine_1.12.0~rc4-0~jessie_armhf.deb

That's exactly the reason why I'd like to have the .deb package in testing on the Docker APT repo. See #24561 (comment).

@tiborvass

This comment has been minimized.

Show comment
Hide comment
@tiborvass

tiborvass Jul 19, 2016

Collaborator

Hmm that sounds weird. Things should work irrespective of whether they were installed or not. Will investigate later. I was hoping I could use qemu or something if I didn't have the device with me. Also easier to automate for testing.

Collaborator

tiborvass commented Jul 19, 2016

Hmm that sounds weird. Things should work irrespective of whether they were installed or not. Will investigate later. I was hoping I could use qemu or something if I didn't have the device with me. Also easier to automate for testing.

Add a Raspbian specific systemd unit file, use overlay by default
Signed-off-by: Dieter Reuter <dieter.reuter@me.com>
@DieterReuter

This comment has been minimized.

Show comment
Hide comment
@DieterReuter

DieterReuter Jul 19, 2016

Contributor

@tiborvass if you like, I could run the complete testing procedure on my local RPi and record an asciinema, so you are able to see the results at least in console mode. WDYT, when can we expect to have the first .deb online for testing?

Contributor

DieterReuter commented Jul 19, 2016

@tiborvass if you like, I could run the complete testing procedure on my local RPi and record an asciinema, so you are able to see the results at least in console mode. WDYT, when can we expect to have the first .deb online for testing?

@DieterReuter

This comment has been minimized.

Show comment
Hide comment
@DieterReuter

DieterReuter Jul 19, 2016

Contributor

I finally did a complete successful test run to install Docker 1.12.0-rc4 on a Raspberry Pi2 with a standard RASPBIAN JESSIE LITE and recorded an asciinema of the whole procedure:
asciicast

As soon as we have the .deb packages uploaded in the Docker APT repo it should work seamlessly.

Contributor

DieterReuter commented Jul 19, 2016

I finally did a complete successful test run to install Docker 1.12.0-rc4 on a Raspberry Pi2 with a standard RASPBIAN JESSIE LITE and recorded an asciinema of the whole procedure:
asciicast

As soon as we have the .deb packages uploaded in the Docker APT repo it should work seamlessly.

Fix typo in comment
Signed-off-by: Dieter Reuter <dieter.reuter@me.com>

@tiborvass tiborvass modified the milestones: 1.12.1, 1.12.0 Jul 27, 2016

@crosbymichael

This comment has been minimized.

Show comment
Hide comment
@crosbymichael

crosbymichael Aug 2, 2016

Contributor

What's the status on this PR? Do we have debs and all that? What are we waiting on?

Contributor

crosbymichael commented Aug 2, 2016

What's the status on this PR? Do we have debs and all that? What are we waiting on?

@StefanScherer

This comment has been minimized.

Show comment
Hide comment
@StefanScherer

StefanScherer Aug 2, 2016

Contributor

Depends on a fix for make deb on ARM, eg. #25192

Contributor

StefanScherer commented Aug 2, 2016

Depends on a fix for make deb on ARM, eg. #25192

@DieterReuter

This comment has been minimized.

Show comment
Hide comment
@DieterReuter

DieterReuter Aug 2, 2016

Contributor

@crosbymichael First, we need to fix the build process on ARM, see #25192. Second, we have to build the Debian packages for ARM and have to upload/release it to the official Docker APT repository. And finally we can merge this PR to activate the install script which is compatible to install Docker directly on a standard Raspbian. That's all I think.

And as a bonus point we can add the Raspbian support even into Docker Machine with this PR docker/machine#3605.

Contributor

DieterReuter commented Aug 2, 2016

@crosbymichael First, we need to fix the build process on ARM, see #25192. Second, we have to build the Debian packages for ARM and have to upload/release it to the official Docker APT repository. And finally we can merge this PR to activate the install script which is compatible to install Docker directly on a standard Raspbian. That's all I think.

And as a bonus point we can add the Raspbian support even into Docker Machine with this PR docker/machine#3605.

@tiborvass

This comment has been minimized.

Show comment
Hide comment
@tiborvass

tiborvass Aug 3, 2016

Collaborator

@crosbymichael i'm working on this one, need to test release scripts now that ARM builds debs.

Collaborator

tiborvass commented Aug 3, 2016

@crosbymichael i'm working on this one, need to test release scripts now that ARM builds debs.

@DieterReuter

This comment has been minimized.

Show comment
Hide comment
@DieterReuter

DieterReuter Aug 10, 2016

Contributor

@tiborvass Any progress here? If you need help, please ping me.

Contributor

DieterReuter commented Aug 10, 2016

@tiborvass Any progress here? If you need help, please ping me.

@tiborvass

This comment has been minimized.

Show comment
Hide comment
@tiborvass

tiborvass Aug 10, 2016

Collaborator

I think I'm having different issues interfere when I tried this, so I'll just go ahead and merge and open an additional PR I needed for the release scripts. Thanks for your work!

Collaborator

tiborvass commented Aug 10, 2016

I think I'm having different issues interfere when I tried this, so I'll just go ahead and merge and open an additional PR I needed for the release scripts. Thanks for your work!

@tiborvass

This comment has been minimized.

Show comment
Hide comment
@tiborvass

tiborvass Aug 10, 2016

Collaborator

LGTM

Collaborator

tiborvass commented Aug 10, 2016

LGTM

@tiborvass tiborvass merged commit a6aea68 into moby:master Aug 10, 2016

8 checks passed

docker/dco-signed All commits signed
Details
documentation success
Details
experimental Jenkins build Docker-PRs-experimental 21397 has succeeded
Details
gccgo Jenkins build Docker-PRs-gccgo 8048 has succeeded
Details
janky Jenkins build Docker-PRs 30074 has succeeded
Details
userns Jenkins build Docker-PRs-userns 12131 has succeeded
Details
win2lin Jenkins build Docker-PRs-Win2Lin 28644 has succeeded
Details
windowsRS1 Jenkins build Docker-PRs-WoW-RS1 636 has succeeded
Details

@tiborvass tiborvass referenced this pull request Aug 11, 2016

Merged

Cherry picks 1.12.1 #25637

@phelix001

This comment has been minimized.

Show comment
Hide comment
@phelix001

phelix001 Feb 5, 2017

I know this is being pedantic, but in the instructions above, chmod +x install.sh before the execution of install.sh. It'll save someone some time. Especially people like me. The error without the chmod is 'file not found', not "not executable"

You do have it in the video.

phelix001 commented Feb 5, 2017

I know this is being pedantic, but in the instructions above, chmod +x install.sh before the execution of install.sh. It'll save someone some time. Especially people like me. The error without the chmod is 'file not found', not "not executable"

You do have it in the video.

@thaJeztah

This comment has been minimized.

Show comment
Hide comment
@thaJeztah

thaJeztah Feb 5, 2017

Member

@phelix001 those instructions were before this PR was merged, you should now be able to

curl -fsSL https://get.docker.com | sh
Member

thaJeztah commented Feb 5, 2017

@phelix001 those instructions were before this PR was merged, you should now be able to

curl -fsSL https://get.docker.com | sh
@nlsdfnbch

This comment has been minimized.

Show comment
Hide comment
@nlsdfnbch

nlsdfnbch Sep 15, 2017

FYI, works as is on a Raspberry Pi 2 running Raspbian Stretch too:

thanos@devBox:~ $ uname -a
Linux devBox 4.9.41-v7+ #1023 SMP Tue Aug 8 16:00:15 BST 2017 armv7l GNU/Linux
thanos@devBox:~ $ head -n 3 /etc/os-release 
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
[...]
thanos@devBox:~ $ sudo docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 17.05.0-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9048e5e50717ea4497b757314bad98ea3763c145
runc version: 9c2d8d184e5da67c95d601382adf14862e4f2228
init version: 949e6fa
Kernel Version: 4.9.41-v7+
Operating System: Raspbian GNU/Linux 9 (stretch)
OSType: linux
Architecture: armv7l
CPUs: 4
Total Memory: 748.9MiB
Name: devBox
ID: P2XX:MFNK:SFYP:HKD5:WM6U:434O:LVW4:5OYP:Z4QF:WO4E:DWE5:7Q73
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

WARNING: No swap limit support
WARNING: No cpu cfs quota support
WARNING: No cpu cfs period support
WARNING: No cpuset support
thanos@devBox:~ $ 

nlsdfnbch commented Sep 15, 2017

FYI, works as is on a Raspberry Pi 2 running Raspbian Stretch too:

thanos@devBox:~ $ uname -a
Linux devBox 4.9.41-v7+ #1023 SMP Tue Aug 8 16:00:15 BST 2017 armv7l GNU/Linux
thanos@devBox:~ $ head -n 3 /etc/os-release 
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
[...]
thanos@devBox:~ $ sudo docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 17.05.0-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9048e5e50717ea4497b757314bad98ea3763c145
runc version: 9c2d8d184e5da67c95d601382adf14862e4f2228
init version: 949e6fa
Kernel Version: 4.9.41-v7+
Operating System: Raspbian GNU/Linux 9 (stretch)
OSType: linux
Architecture: armv7l
CPUs: 4
Total Memory: 748.9MiB
Name: devBox
ID: P2XX:MFNK:SFYP:HKD5:WM6U:434O:LVW4:5OYP:Z4QF:WO4E:DWE5:7Q73
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

WARNING: No swap limit support
WARNING: No cpu cfs quota support
WARNING: No cpu cfs period support
WARNING: No cpuset support
thanos@devBox:~ $ 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment