Jump to content

Docker on armbian!


Recommended Posts

Hello everyone!

 

Is there anyone who tried to run Docker on armbian?

 

Ok, let's start from the beginning: I am from the Hypriot Team (we made Docker available on ARM) and recently saw some guys successfully playing with Docker on armbian. Meanwhile, we know, that our Docker runs at least on the Cubietrack and Lamobo R1/BananaPi R1 on top of armbian!

 

This is awesome because, you know, IoT is coming, and Docker on ARM helps get a grip on many challenges induced by IoT. However, we were only able to support Docker on Raspberry Pis so far...  Imagine if Docker would run on more than just a few ARM boards! Armbian seems an awesome platform to extend the family of Docker compatible boards.

 

So, I wonder if there is anyone who tried to run Docker on armbian?

 

If you are now curious about this topic and wanna get started, please see this blog post of how to install Docker on ARM within no time: http://blog.hypriot.com/post/family_arm_hardware_for_docker_more_children/

 

Looking forward to get in touch with you guys!

Link to comment
Share on other sites

@MathiasRenner:

 

The deb-package you're refering is working fine on a BananaPi and Igor's image (self compiled). Don't know which additional information you need:

(I removed some columns)

| __ )  __ _ _ __   __ _ _ __   __ _ 
|  _ \ / _` | '_ \ / _` | '_ \ / _` |
| |_) | (_| | | | | (_| | | | | (_| |
|____/ \__,_|_| |_|\__,_|_| |_|\__,_|
                                     
Welcome to ARMBIAN (Debian sid 4.2.6-sunxi)

Last login: Wed Dec  9 17:50:05 2015 from 192.xxx.xxx.xxx

Load: 0.31, 0.38, 0.40 - Board: 35.5°C - Memory: 1097Mb

andy@bananapi:~$ uname -a
Linux bananapi 4.2.6-sunxi #1 SMP Sun Nov 29 10:33:44 CET 2015 armv7l GNU/Linux
andy@bananapi:~$ docker -v
Docker version 1.9.1, build a34a1d5
andy@bananapi:~$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS      
3fdb3b7fa809        owntracks           "/bin/bash"              2 hours ago         Up 2 hours                                                                 
c162d841bed9        openhab             "/bin/bash /start.sh"    5 hours ago         Up 5 hours  
38ed57e5947d        pynetatmo           "/usr/local/bin/super"   25 hours ago        Up 25 hours                                                      
91b90abc5370        node-red            "/bin/sh -c '/usr/loc"   33 hours ago        Up 33 hours 
114cbbaddc53        owntrack_mqtt       "/bin/bash /start.sh"    46 hours ago        Up 46 hours  
6c4782af0a4d        mqtt                "/bin/sh -c '/usr/sbi"   2 days ago          Up 2 days   
1858bc27fdff        smsserver           "/bin/bash /start.sh"    8 days ago          Up 8 days        

Yes, it's a huge improvement to see a cooperation between both projects!

 

~September~

Link to comment
Share on other sites

@Skygod: I don't know how different M1+ is from M2, of which Hosteiner mentioned it works fine. If there is a difference, it would be cool to see it it works on the M1+ as well!

 

@Holsteiner: The Docker version in this image is probably by far not latest, but will probably work fine, which is good to see!

 

Performance of Docker? Like charm :-) See this is docker daemon without any containers:

$ ps -p 1277 -o %cpu,%mem,cmd
%CPU %MEM CMD
 1.1  2.8 /usr/bin/docker daemon -H fd:// --storage-driver=overlay -D

Let's start 20 webservers (https://hub.docker.com/r/hypriot/rpi-busybox-httpd/), i.e. starting 20 containers, and check again:

%CPU %MEM CMD
 6.5  3.4 /usr/bin/docker daemon -H fd:// --storage-driver=overlay -D

Note, that this is just the Docker daemon as "container manager" instance!

 

For each container, Docker starts 4 processes. Please do not ask me why. Let's rather have a look at CPU and RAM:

With 20 webservers running, CPU usage in total and average is about 4%. Before starting these 20 containers, it was a bit more than 2% in average.

RAM usage is 162 MB. Before starting the 20 containers, it was 46 MB.

 

So in general, only the Docker daemon is put on top. For containers, Docker's footprint is about the same as if you run apps natively. For this test, I used HypriotOS (http://blog.hypriot.com/) on a Raspberry Pi 2 B.

You also can define how much CPU and RAM a container is allowed to have at max, and also in relation to other containers. Docker offers many options to make sure you are in control about available resources.

 

And, BTW, with some tweaking, it's possible to start 2500 containers on a single Raspberry Pi with Docker :-) -> https://blog.docker.com/2015/10/raspberry-pi-dockercon-challenge-winner/

 

@September: I can see that several containers are running, which shows that Docker works well, awesome! Thanks for your feedback! Yeah, we are not sure yet how much work it is, but we at least try to get together...

Link to comment
Share on other sites

@Skygod: I don't know how different M1+ is from M2, of which Hosteiner mentioned it works fine. If there is a difference, it would be cool to see it it works on the M1+ as well!

 

Two very different beasts. (M1+ is more similar to the R1)

 

I can't test at the moment as my SD image is running with a kernel that is not supported.

Link to comment
Share on other sites

ok :)

see...

 

gr@bpi:/var/lib/docker$ cat /etc/armbian.txt
--------------------------------------------------------------------------------

Title:                  Armbian 4.6 Lamobo-r1 Ubuntu trusty next (unofficial)
Kernel:                 Linux 4.3.0
Build date:             06.11.2015

gr@bpi:/var/lib/docker$ sudo docker version
Client:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.4.3
 Git commit:   a34a1d5
 Built:        Fri Nov 20 23:03:02 UTC 2015
 OS/Arch:      linux/arm

Server:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.4.3
 Git commit:   a34a1d5
 Built:        Fri Nov 20 23:03:02 UTC 2015
 OS/Arch:      linux/arm

gr@bpi:/var/lib/docker$ sudo docker ps -a
CONTAINER ID        IMAGE                       COMMAND                  CREATED             STATUS              PORTS                  NAMES
815d0a3de6df        hypriot/rpi-busybox-httpd   "/bin/busybox httpd -"   4 minutes ago       Up 4 minutes        0.0.0.0:8080->80/tcp   grave_ptolemy

gr@odroid:~$ lynx http://192.168.0.250:8080

                                                                                                             Pi armed with Docker by Hypriot
   pi armed with docker

note :

 

kernel is Armbian based but 4.3.0 + patches

 

also it is Trusty based (with some packages from jessie)

gr@bpi:~$ cat /etc/apt/preferences
[...]
Package: *
Pin: release n=trusty
Pin-Priority: 950
[...]
Package: *
Pin: release n=jessie
Pin-Priority: 100
[...]
Package: *
Pin: release o=Ubuntu
Pin-Priority: 1100

Package: *
Pin: release o=Debian
Pin-Priority: -10

 

 

I add to comment to start docker server:

gr@bpi:~$ cat /etc/init.d/docker

[...]
# see also init_is_upstart in /lib/lsb/init-functions (which isn't available in Ubuntu 12.04, or we'd use it)
#if [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | grep -q upstart; then
#       log_failure_msg "$DOCKER_DESC is managed via upstart, try using service $BASE $1"
#       exit 1
#fi

Edited by wildcat_paris
Link to comment
Share on other sites


gr@bpi:~$ docker ps -a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

4a3bcbd40604 hypriot/rpi-tor-relay "tor -f /etc/tor/torr" 2 minutes ago Up 2 minutes 0.0.0.0:9001->9001/tcp tor-relay

815d0a3de6df hypriot/rpi-busybox-httpd "/bin/busybox httpd -" 43 minutes ago Exited (137) 21 minutes ago grave_ptolemy

 

 

gr@bpi:~$ ps axf

 

10476 ? Sl 0:32 /usr/bin/docker -d=true -p /var/run/docker.pid --storage-driver=overlay -D

13711 ? Sl 0:00 \_ docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 9001 -container-ip 172.17.0.2 -container-port 9001

13846 ? Ssl 0:34 \_ tor -f /etc/tor/torrc.bridge

 

Link to comment
Share on other sites

Thank you for the porting and the instructions.

I'm testing it on an Olimex A20-OLinuXIno-LIME2 (https://www.olimex.com/Products/OLinuXino/A20/A20-OLinuXIno-LIME2/open-source-hardware) with armibian (jessie).

 

The installation worked. Just a remark, on running `apt-get -y install cgroupfs-mount` it removed the `console-common` package. Is this intended?

 

 

 

The `check-config.sh` script has following output:

# ./check-config.sh 
info: reading kernel config from /proc/config.gz ...

Generally Necessary:
- cgroup hierarchy: properly mounted [/sys/fs/cgroup]
- CONFIG_NAMESPACES: enabled
- CONFIG_NET_NS: enabled
- CONFIG_PID_NS: enabled
- CONFIG_IPC_NS: enabled
- CONFIG_UTS_NS: enabled
- CONFIG_DEVPTS_MULTIPLE_INSTANCES: enabled
- CONFIG_CGROUPS: enabled
- CONFIG_CGROUP_CPUACCT: enabled
- CONFIG_CGROUP_DEVICE: enabled
- CONFIG_CGROUP_FREEZER: enabled
- CONFIG_CGROUP_SCHED: enabled
- CONFIG_CPUSETS: enabled
- CONFIG_MEMCG: enabled
- CONFIG_KEYS: enabled
- CONFIG_MACVLAN: enabled (as module)
- CONFIG_VETH: enabled (as module)
- CONFIG_BRIDGE: enabled
- CONFIG_BRIDGE_NETFILTER: enabled (as module)
- CONFIG_NF_NAT_IPV4: enabled (as module)
- CONFIG_IP_NF_FILTER: enabled (as module)
- CONFIG_IP_NF_TARGET_MASQUERADE: enabled (as module)
- CONFIG_NETFILTER_XT_MATCH_ADDRTYPE: enabled (as module)
- CONFIG_NETFILTER_XT_MATCH_CONNTRACK: enabled (as module)
- CONFIG_NF_NAT: enabled (as module)
- CONFIG_NF_NAT_NEEDED: enabled
- CONFIG_POSIX_MQUEUE: enabled

Optional Features:
- CONFIG_USER_NS: enabled
- CONFIG_SECCOMP: missing
- CONFIG_CGROUP_PIDS: missing
- CONFIG_MEMCG_KMEM: enabled
- CONFIG_MEMCG_SWAP: enabled
- CONFIG_MEMCG_SWAP_ENABLED: enabled
- CONFIG_BLK_CGROUP: enabled
- CONFIG_IOSCHED_CFQ: enabled
- CONFIG_BLK_DEV_THROTTLING: enabled
- CONFIG_CGROUP_PERF: enabled
- CONFIG_CGROUP_HUGETLB: missing
- CONFIG_NET_CLS_CGROUP: missing
- CONFIG_CGROUP_NET_PRIO: enabled
- CONFIG_CFS_BANDWIDTH: enabled
- CONFIG_FAIR_GROUP_SCHED: enabled
- CONFIG_RT_GROUP_SCHED: enabled
- CONFIG_EXT3_FS: missing
- CONFIG_EXT3_FS_XATTR: missing
- CONFIG_EXT3_FS_POSIX_ACL: missing
- CONFIG_EXT3_FS_SECURITY: missing
    (enable these ext3 configs if you are using ext3 as backing filesystem)
- CONFIG_EXT4_FS: enabled
- CONFIG_EXT4_FS_POSIX_ACL: enabled
- CONFIG_EXT4_FS_SECURITY: enabled
- Storage Drivers:
  - "aufs":
    - CONFIG_AUFS_FS: missing
  - "btrfs":
    - CONFIG_BTRFS_FS: enabled
  - "devicemapper":
    - CONFIG_BLK_DEV_DM: enabled (as module)
    - CONFIG_DM_THIN_PROVISIONING: enabled (as module)
  - "overlay":
    - CONFIG_OVERLAY_FS: enabled (as module)
  - "zfs":
    - /dev/zfs: missing
    - zfs command: missing
    - zpool command: missing

But the daemon doesn't start:

# service docker status
[FAIL] Docker is not running ... failed!
# service docker start
[ ok ] Starting Docker: docker.
# service docker status
[FAIL] Docker is not running ... failed!
# docker version
Client:
 Version:      1.10.3
 API version:  1.22
 Go version:   go1.4.3
 Git commit:   20f81dd
 Built:        Thu Mar 10 22:23:48 2016
 OS/Arch:      linux/arm
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

When I start the daemon manually it runs:

# docker daemon 
WARN[0001] devmapper: Usage of loopback devices is strongly discouraged for production use. Please use `--storage-opt dm.thinpooldev` or use `man docker` to refer to dm.thinpooldev section. 
WARN[0002] devmapper: XFS is not supported in your system. Either the kernel doesnt support it or mkfs.xfs is not in your PATH. Defaulting to ext4 filesystem 
INFO[0002] devmapper: Creating filesystem ext4 on device docker-179:1-387353-base 
INFO[0224] devmapper: Successfully created filesystem ext4 on device docker-179:1-387353-base 
INFO[0224] Graph migration to content-addressability took 0.00 seconds 
INFO[0224] Firewalld running: false                     
INFO[0224] Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address 
INFO[0225] Loading containers: start.                   

INFO[0225] Loading containers: done.                    
INFO[0225] Daemon has completed initialization          
INFO[0225] Docker daemon                                 commit=20f81dd execdriver=native-0.2 graphdriver=devicemapper version=1.10.3
INFO[0225] API listen on /var/run/docker.sock           

… [another terminal]
# docker version
Client:
 Version:      1.10.3
 API version:  1.22
 Go version:   go1.4.3
 Git commit:   20f81dd
 Built:        Thu Mar 10 22:23:48 2016
 OS/Arch:      linux/arm

Server:
 Version:      1.10.3
 API version:  1.22
 Go version:   go1.4.3
 Git commit:   20f81dd
 Built:        Thu Mar 10 22:23:48 2016
 OS/Arch:      linux/arm

So generally, it works, but the provided init script doesn't work, even outcommenting those lines as @wildcat_paris wrote didn't help:

# see also init_is_upstart in /lib/lsb/init-functions (which isn't available in Ubuntu 12.04, or we'd use it)
#if [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | grep -q upstart; then
#	log_failure_msg "$DOCKER_DESC is managed via upstart, try using service $BASE $1"
#	exit 1
#fi

Link to comment
Share on other sites

I can't install on a Orange Pi One, I try your Getting started guide from Hypriot and the guide from Docker to common Linux OS. I have many other Docker running on top of ARM boards: ODROID-C1 and ODROID-U3 and also an Android Stick TV UG802 with RK3066 processor using Picuntu.

Link to comment
Share on other sites

Hmmmm I'm new to Docker so just testing. I see some errors:

root@orangepione:~# docker run -i -t ubuntu /bin/bash
Unable to find image 'ubuntu:latest' locally
latest: Pulling from library/ubuntu
87192bdbe00f: Pull complete
28e09fddaacb: Pull complete
7e15ce58ccb2: Pull complete
a3ed95caeb02: Pull complete
Digest: sha256:f6e8757419147ba099af8cec4db365b3603472bd6182722b16fdae932c0bf3bf
Status: Downloaded newer image for ubuntu:latest
docker: Error response from daemon: open /var/lib/docker/overlay/cdef9a12e80f2eae26c4e4b66af2ee8af8a4577b1d6d6d898b1575d8a99f7c7e-init/merged/.dockerinit: operation not permitted.
See 'docker run --help'.
root@orangepione:~# docker pull busybox
Using default tag: latest
latest: Pulling from library/busybox
385e281300cc: Pull complete
a3ed95caeb02: Pull complete
Digest: sha256:4a887a2326ec9e0fa90cce7b4764b0e627b5d6afcb81a3f73c85dc29cea00048
Status: Downloaded newer image for busybox:latest
root@orangepione:~# docker run -it --rm busybox
docker: Error response from daemon: open /var/lib/docker/overlay/561da1c9004517d94d57d4e417098b2d42f1cddf2bd227afa9e724b4e6c5401c-init/merged/.dockerinit: operation not permitted.
See 'docker run --help'.

in kern.log

Apr  9 11:16:07 localhost kernel: [  591.821731] EXT4-fs warning (device mmcblk0p1): ext4_file_open:381: Inconsistent encryption contexts: 7517/154551
Apr  9 11:16:07 localhost kernel: [  591.821731]
Apr  9 12:22:58 localhost kernel: [ 4602.820036] EXT4-fs warning (device mmcblk0p1): ext4_file_open:381: Inconsistent encryption contexts: 7659/154612
Apr  9 12:22:58 localhost kernel: [ 4602.820036]
Link to comment
Share on other sites

Two thoughts:

 

1) Create a normal user (instead of user root) to run your docker container. Don't forget to add the newly created user to group 'docker'

2) Use the correct container images (armhf!), search a suitable image with command:

user@bananapi:~$ docker search armhf
NAME                                  DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
armv7/armhf-ubuntu                    'official' Ubuntu Docker images for the AR...   22                   
armv7/armhf-archlinux                 archlinux arm Docker image for the ARMv7(a...   11                   
container4armhf/armhf-alpine          Automatically built base images of Alpine ...   10                   [OK]
ioft/armhf-ubuntu                     [ABR] Ubuntu Docker images for the ARMv7(a...   10                   [OK]
mazzolino/armhf-ubuntu                Ubuntu-Core images for armhf (ARMv7) devices    6                    
armv7/armhf-ubuntu_core               Ubuntu Core Docker images for the ARMv7(ar...   5                    
armhf/ubuntu                          Ubuntu is a Debian-based Linux operating s...   2                    
moul/armhf-busybox                                                                    2                    [OK]
...
Link to comment
Share on other sites

Same issue as @op1tjaap:

Welcome to ARMBIAN Debian GNU/Linux 8 (jessie) 4.5.1-sunxi 
john@cubietruck:~$ docker run -d -p 80:80 hypriot/rpi-busybox-httpd
docker: Error response from daemon: open /var/lib/docker/overlay/44fbad743683f30fcfbed42c5cec62e7152a7e1e81395ae22de2f738ddabc3e8-init/merged/.dockerinit: operation not permitted.
See 'docker run --help'.

The Docker guys are waiting for a patch that affects the 4.5 kernel:

 

For some reason overlayfs on ext4 treated by kernel as "encrypted" volume in new kernels.

 

 

Going back to a 4.4x kernel makes Docker happy again. Loonix sucks donkey balls.

Link to comment
Share on other sites

It's working with this patch - added:

https://github.com/igorpecovnik/lib/commit/879c8920152e772b6e8f67927c602d620d39aa96

Linux bananapim2 4.5.1-sunxi #3 SMP Tue Apr 19 11:23:03 CEST 2016 armv7l GNU/Linux

Debian Jessie

docker run -d -p 80:80 hypriot/rpi-busybox-httpd
Unable to find image 'hypriot/rpi-busybox-httpd:latest' locally
latest: Pulling from hypriot/rpi-busybox-httpd
c74a9c6a645f: Pull complete 
6f1938f6d8ae: Pull complete 
e1347d4747a6: Pull complete 
a3ed95caeb02: Pull complete 
Digest: sha256:c00342f952d97628bf5dda457d3b409c37df687c859df82b9424f61264f54cd1
Status: Downloaded newer image for hypriot/rpi-busybox-httpd:latest
875ad9221bbb5c6b2357bc52afa0083c1fc38ed61ecc522b03ef976be0844d77
Link to comment
Share on other sites

That was quick, thank you Igor :)

 
The more I give the 4.x kernel a real-use try the faster I go back to 3.x. Btw Igor, I read in another thread that you run the forum on
single-board, which kernel are you using?
 
Given that the Cubietruck sucks as a media server, I'm thinking of turning it into a web/app/storage server. Kernel 4.x would make sense but
most things are still a cat-and-mouse chase. What would you suggest if you've had a Cubietruck?
Link to comment
Share on other sites

Armbian Docker support is coming officially with next version and it would be pity if it is broken ;) Not long time ago I fixed all 3.10+ kernels which could run docker. Config has been tested almost on all.

 

Web server still uses legacy kernel 3.4.106, built one year ago ... since it's working without any problem I leave it as is. I plan to upgrade to some better hardware to get more responsiveness and with mainline kernel. It will be one of those single boards. For moderate usage Cubietruck should be just fine.

Link to comment
Share on other sites

Hello,

 

I've been trying to get Docker to work with Armbian on Odroid xu4. Installation works but docker daemon wont start as it seems there are some modules missing from the kernel. Trying to start the daemon manually prints following output:

WARN[0001] Your kernel does not support cgroup memory limit 
WARN[0001] Unable to find blkio cgroup in mounts        
WARN[0001] Unable to find cpuset cgroup in mounts       
WARN[0001] mountpoint for pids not found                
FATA[0001] Error starting daemon: Devices cgroup isn't mounted 

This is with the latest Jessie server image: http://mirror.igorpecovnik.com/Armbian_5.14_Odroidxu4_Debian_jessie_3.10.102.7z

 

Any help appreciated!

post-1529-0-38140900-1466906220_thumb.png

Link to comment
Share on other sites

I guess we forgot/failed to merge configuration. There is no other way than recompile kernel with proper configuration - to enable what's missing. I own one XU4 and that one is serving this forum so can't do the testing but will try to prepare a kernel update ASAP.

Link to comment
Share on other sites

@lavvy

 

Beelink x2 legacy kernel, which is currently the only working one), is too old for Docker but it will be possible with Vanilla kernels when they wlll be ready for H3 chipset.

 

On S905 based boxes which runs Odroid C2 kernel should alteady work.

 

Wrote on mobile phone

Link to comment
Share on other sites

oh ok thanks @lgor for the answer , i had thought as much for the S905 boxes but i have not got them yet. i was particularly happy at the coming of S905s to armbian, cos most of the heavy lifting have been done at odroids. 

please could you confirm if kodi could run too.. xeosal has adapted hw accelerated and 4k kodi to odroid C2.   http://forum.odroid.com/viewtopic.php?f=136&t=19433

Link to comment
Share on other sites

@lavvy

 

Beelink x2 legacy kernel, which is currently the only working one), is too old for Docker but it will be possible with Vanilla kernels when they wlll be ready for H3 chipset.

 

On S905 based boxes which runs Odroid C2 kernel should alteady work.

 

Wrote on mobile phone

@lgor is there any time frame for the Vanilla kernels for the beelink x2

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines