Docker on Odroid-XU a few years later (Ubuntu 14.04, kernel 3.13.11)

Post Reply
insid3r
Posts: 9
Joined: Thu Jan 23, 2014 7:18 pm
languages_spoken: english
ODROIDs: XU-Lite + 8Gb eMMC
Has thanked: 0
Been thanked: 2 times
Contact:

Docker on Odroid-XU a few years later (Ubuntu 14.04, kernel 3.13.11)

Post by insid3r »

Hi guys,

I'll share with you how to get Docker to work on Odroid XU. A few things first:
- Docker requires kernel > 3.10 (which you need to compile one by yourself)
- Docker requires a few kernel flags to be enabled (Docker check-config.sh)
- This was done with the clean Ubuntu 14.04 image from here

1) Update sources.list by replacing the existent:

Code: Select all

deb http://ports.ubuntu.com/ubuntu-ports/ trusty main universe multiverse restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty main universe multiverse restricted
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main universe multiverse restricted
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-security main universe multiverse restricted
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-proposed main universe multiverse restricted
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-backports main universe multiverse restricted
2) Update your distro

Code: Select all

apt-get update; apt-get upgrade
1) How to compile kernel > 3.10?
I found in the forum that we had available a 3.13 kernel in the hardkernel repo.

Code: Select all

git clone https://github.com/hardkernel/linux.git -b odroid-3.13.y --depth 1
Generate the default .config for odroid-xu

Code: Select all

make odroidxu_defconfig
Now you need to append the Docker needed flags to .config file (copied from here)

Code: Select all

#Docker
CONFIG_NAMESPACES=y
CONFIG_NET_NS=y
CONFIG_PID_NS=y
CONFIG_IPC_NS=y
CONFIG_UTS_NS=y

CONFIG_CGROUPS=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_SCHED=y
CONFIG_CPUSETS=y
CONFIG_MEMCG=y
CONFIG_KEYS=y
CONFIG_VETH=y
CONFIG_BRIDGE=y
CONFIG_NETFILTER=y
CONFIG_INET=y

CONFIG_EXPERIMENTAL=y
CONFIG_NETFILTER=y
CONFIG_NF_NAT_IPV4=m
CONFIG_NF_CONNTRACK_IPV4=m
CONFIG_NF_CONNTRACK=y
CONFIG_NETFILTER_ADVANCED=y
CONFIG_IP_NF_FILTER=m
CONFIG_IP_NF_TARGET_MASQUERADE=m
CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m
CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
CONFIG_IP_VS=y
CONFIG_NETFILTER_XT_MATCH_IPVS=m
CONFIG_IP_NF_NAT=m
CONFIG_NF_NAT=m
CONFIG_NF_NAT_NEEDED=y
CONFIG_POSIX_MQUEUE=y
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y

CONFIG_USER_NS=y
CONFIG_SECCOMP=y
CONFIG_CGROUP_PIDS=y

CONFIG_MEMCG_SWAP=y
CONFIG_SLAB=y
CONFIG_SLUB=y
CONFIG_MEMCG_SWAP_ENABLED=y
CONFIG_MEMCG_KMEM=y

CONFIG_RESOURCE_COUNTERS=y
CONFIG_BLK_CGROUP=y
CONFIG_BLK_DEV_THROTTLING=y
CONFIG_IOSCHED_CFQ=y
CONFIG_CFQ_GROUP_IOSCHED=y
CONFIG_CGROUP_PERF=y
CONFIG_HUGETLB_PAGE=y
CONFIG_CGROUP_HUGETLB=y
CONFIG_NET_CLS_CGROUP=y
CONFIG_NETPRIO_CGROUP=y
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_CFS_BANDWIDTH=y
CONFIG_RT_GROUP_SCHED=y
CONFIG_IP_VS=y
CONFIG_IP_VS_NFCT=y
CONFIG_IP_VS_RR=y

CONFIG_EXT3_FS=y
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT3_FS_POSIX_ACL=y
CONFIG_EXT3_FS_SECURITY=y

CONFIG_EXT4_FS=y
CONFIG_EXT4_USE_FOR_EXT2=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y

#Network
CONFIG_VXLAN=y
CONFIG_CRYPTO=y
CONFIG_CRYPTO_GCM=m
CONFIG_CRYPTO_SEQIV=m
CONFIG_CRYPTO_GHASH=m

CONFIG_XFRM=y
CONFIG_XFRM_ALGO=m
CONFIG_XFRM_USER=m
CONFIG_XFRM_ALGO=y

CONFIG_INET_ESP=y
CONFIG_INET_XFRM_MODE_TRANSPORT=y

CONFIG_VXLAN=m
CONFIG_IPVLAN=m
CONFIG_DUMMY=m
CONFIG_MACVLAN=m
CONFIG_NF_NAT_FTP=m
CONFIG_NF_CONNTRACK_FTP=m
CONFIG_NF_NAT_TFTP=m
CONFIG_NF_CONNTRACK_TFTP=m

#BTRFS part
CONFIG_BTRFS_FS=m
CONFIG_BTRFS_FS_POSIX_ACL=m

#BTRFS part
CONFIG_BLK_DEV_DM=y
CONFIG_DM_THIN_PROVISIONING=m

#OVERLAY part
CONFIG_OVERLAY_FS=m
Then you can compile the kernel. These instructions were copied from algermike post
During make command press Y for adding the prompted flags.

Code: Select all

make -j5 uImage dtbs zImage modules									
make modules_install											

kernelversion=`cat ./include/config/kernel.release`
cp .config /boot/config-$kernelversion 	
mkinitramfs -c gzip -o ./initramfs-$kernelversion $kernelversion
mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d ./initramfs-$kernelversion ./uInitrd
cp uInitrd /boot/uInitrd-$kernelversion

mkdir staging
cp arch/arm/boot/zImage staging
cp arch/arm/boot/dts/exynos5410-odroidxu.dtb staging
cp uInitrd staging
cp /media/boot/boot.ini staging
cp /media/boot/u-boot.bin staging

# Edit boot.ini to use exynos5410-odroidxu.dtb
# replace bootcmd for:
# setenv bootcmd "fatload mmc 0:1 0x40008000 zImage; fatload mmc 0:1 0x42000000 uInitrd; fatload mmc 0:1 0x46000000 exynos5410-odroidxu.dtb; bootz 0x40008000 0x42000000 0x46000000"
nano staging/boot.ini

cp staging/* /media/boot
sync
reboot
Install docker

Code: Select all

wget -qO- https://get.docker.com/ | sh
ln -sf /usr/bin/docker /usr/local/bin/docker
sed -i '$acomplete -F _docker docker' /etc/bash_completion.d/docker
update-rc.d docker default
Running docker run hello-world will throw:

Code: Select all

docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:297: copying bootstrap data to pipe caused \"write init-p: broken pipe\"": unknown.
ERRO[0002] error waiting for container: context canceled 
To fix this you need to rollback to a previous patch by doing:

Code: Select all

apt-get install docker-ce=18.06.1~ce~3-0~ubuntu
And then:

Code: Select all

root@odroid-server:~# docker run hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (arm32v7)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/
Hope it helps someone else to resurrect its Odroid-XU.
Cheers
These users thanked the author insid3r for the post (total 2):
odroid (Thu Apr 09, 2020 10:03 am) • doggisbag (Sun Jul 26, 2020 6:47 am)

Nuems
Posts: 162
Joined: Thu Sep 19, 2013 3:50 am
languages_spoken: english, german
ODROIDs: xu, c1, n2
Has thanked: 1 time
Been thanked: 10 times
Contact:

Re: Docker on Odroid-XU a few years later (Ubuntu 14.04, kernel 3.13.11)

Post by Nuems »

So does kernel 3.13 work reliably for you? I also used the unexpected time at home to tinker a bit with my XU, but my experiments with kernels 3.13/3.14 were fairly disappointing (network problems, usb3 usabilty, general stability).

insid3r
Posts: 9
Joined: Thu Jan 23, 2014 7:18 pm
languages_spoken: english
ODROIDs: XU-Lite + 8Gb eMMC
Has thanked: 0
Been thanked: 2 times
Contact:

Re: Docker on Odroid-XU a few years later (Ubuntu 14.04, kernel 3.13.11)

Post by insid3r »

I find it quite stable, still have to manage the USB3 problem and the fan noise (this one should be easy).
Any tip would help

Nuems
Posts: 162
Joined: Thu Sep 19, 2013 3:50 am
languages_spoken: english, german
ODROIDs: xu, c1, n2
Has thanked: 1 time
Been thanked: 10 times
Contact:

Re: Docker on Odroid-XU a few years later (Ubuntu 14.04, kernel 3.13.11)

Post by Nuems »

Regarding the fan noise: I think there was a script dealing with that in the Arch image someone published at the time, however, the link to that image (somewhere in the "Other OS" subforum iirc) doesn't work anymore - I tried that before compiling my own kernels the other week. There were several solutions for XU3/4 fan control in the April, May, and October issues of Odroid magazine in 2015 which might be adapted.

doggisbag
Posts: 2
Joined: Wed Nov 20, 2019 7:46 am
languages_spoken: english, spanish
ODROIDs: 2x Odroid-XU
Has thanked: 3 times
Been thanked: 1 time
Contact:

Re: Docker on Odroid-XU a few years later (Ubuntu 14.04, kernel 3.13.11)

Post by doggisbag »

Thanks!, your guide was quite helpful to bring up docker for enabling a home automation project with home-assistant :)

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 1 guest