Get Docker running on Khadas VIM

Hello. Docker that’s exactly what I want (a Khadas VIM Pro Docker Swarm : ) I have 5 VIMs in front and me and the Android performance/integration is great… but now, I want to run ubuntu server or something similar on these little boxes and enable docker.

Have you tried to install and run the latest docker successfully? Was it difficult in some way? Have you experienced any kernel compatibility issues with docker? Did you follow the official docker guidelines (Redirecting…)?

Hi, mcahornsirup:
We haven’t get Docker running on Khadas VIM yet, but we will do that. will update the news in a few days.

1 Like

There was a discussion on running Docker in the Armbian forums.

Update, Link.

2 Likes

I’ve written a small How-To explaining the necessary steps to get Docker up and running on ARM.
The most crucial part is to build a custom kernel, which fulfils the necessary Docker requirements.

Once the VIM board has arrived I can test it by myself.

Cheers
Uli

2 Likes

Hi Uli,

that’s great! I’am going to try this tonight … and keep you in the loop :slight_smile:

I’ve prepared a PR to khadas/linux on GitHub, enabling some Docker support.

1 Like

Hi, Uli:
We will do some test, then merge it.

Thanks for your contribution! :sunny:

Hi, Uli:

Did you got these compiling error:

gouwa@Server:~/project/khadas/ubuntu/linux$ make ARCH=arm64 kvim_defconfig
KBUILD_CFLAGS_MODULE:-DMODULE
drivers/net/wireless/bcmdhd/Kconfig:50:warning: defaults for choice values not supported
#
# configuration written to .config
#
gouwa@Server:~/project/khadas/ubuntu/linux$ make -j8 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image kvim.dtb modules
KBUILD_CFLAGS_MODULE:-DMODULE  -mfix-cortex-a53-835769
KBUILD_CFLAGS_MODULE:-DMODULE
scripts/kconfig/conf --silentoldconfig Kconfig
drivers/net/wireless/bcmdhd/Kconfig:50:warning: defaults for choice values not supported
KBUILD_CFLAGS_MODULE:-DMODULE  -mfix-cortex-a53-835769
  CHK     include/generated/uapi/linux/version.h
		Build time: Wed Feb 22 17:11:21 CST 2017
		Khadas: Something a little different!

  CHK     include/generated/utsrelease.h
make[1]: `arch/arm64/boot/dts/kvim.dtb' is up to date.
  CALL    scripts/checksyscalls.sh
<stdin>:1232:2: warning: #warning syscall renameat2 not implemented [-Wcpp]
  CHK     include/generated/compile.h
  CC      mm/memcontrol.o
  CC      mm/page_cgroup.o
mm/memcontrol.c: In function ‘mem_cgroup_allow_attach’:
mm/memcontrol.c:7116:2: error: passing argument 1 of ‘subsys_cgroup_allow_attach’ from incompatible pointer type [-Werror]
  return subsys_cgroup_allow_attach(css->cgroup, tset);
  ^
In file included from include/linux/memcontrol.h:22:0,
                 from mm/memcontrol.c:29:
include/linux/cgroup.h:860:5: note: expected ‘struct cgroup_subsys_state *’ but argument is of type ‘struct cgroup *’
 int subsys_cgroup_allow_attach(struct cgroup_subsys_state *css,
     ^
cc1: all warnings being treated as errors
make[1]: *** [mm/memcontrol.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [mm] Error 2
make: *** Waiting for unfinished jobs....
  GZIP    kernel/config_data.gz
  CHK     kernel/config_data.h
  UPD     kernel/config_data.h
  CC      kernel/configs.o
  LD      kernel/built-in.o
  LD      drivers/amlogic/built-in.o
  LD      drivers/built-in.o
gouwa@Server:~/project/khadas/ubuntu/linux$ git log
commit 2a0514c9fd3e33415f48bad590ff9df82105d875
Author: Uli Middelberg <uli@middelberg.de>
Date:   Thu Feb 16 23:30:29 2017 +0000

    Khadas VIM: Docker support added

Hi Gouwa,

yes, I’m getting these compiler errors as well. I’ll modify the PR.

1 Like

Hi Gouwa,

I was able to get rid of the compiler errors and I’ll update the PR on GitHub in a couple of minutes. Now I have an idea why you’ve build all drivers as build-in modules, but I was able to fix this as well. To accomplish this I needed to disable some of the previously enabled kernel options. IMHO the kernel sources aren’t in a very good shape. If you have the chance to, you might try to combine the HK sources with your device tree.

Yes, it’s not a good idea to built all drivers into kernel directly, some drivers should be as modules. We did it as the Amlogic official linux source with built-in one, we will take some time on that for testing first at next build.

1 Like

Now, I have Docker up and running on the Khadas VIM

ubuntu@kvim:~$ docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 1.12.6
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 0
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge overlay null host
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: apparmor seccomp
Kernel Version: 3.14.29
Operating System: Ubuntu 16.04.2 LTS
OSType: linux
Architecture: aarch64
CPUs: 4
Total Memory: 1.766 GiB
Name: kvim
ID: 3PMB:DL4E:C6WX:RUGH:5QVQ:HAYD:IK65:XKKL:UU2W:7HWC:3LXB:DTXM
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Insecure Registries:
 127.0.0.0/8
ubuntu@kvim:~$ docker run -i -t aarch64/ubuntu
Unable to find image 'aarch64/ubuntu:latest' locally
latest: Pulling from aarch64/ubuntu
8944e166ce98: Pull complete
1f8c28d8b7a9: Pull complete
9dbf9f348171: Pull complete
5cb9db57901b: Pull complete
7e21759f0cbf: Pull complete
Digest: sha256:e76f340967a53686298c57e4d388218652f01dc9b4905e8bd32b9d2bcbc4cfa4
Status: Downloaded newer image for aarch64/ubuntu:latest
root@55ca67347905:/# exit
exit
ubuntu@kvim:~$ docker run -i -t armv7/armhf-ubuntu
Unable to find image 'armv7/armhf-ubuntu:latest' locally
latest: Pulling from armv7/armhf-ubuntu
48204675bcf4: Pull complete
deeb9290741f: Pull complete
0e2df1498638: Pull complete
dba9c823b8e9: Pull complete
Digest: sha256:fc32949ab8547c9400bb804004aa3d36fd53d2fedba064a9594a173a6ed4a3b6
Status: Downloaded newer image for armv7/armhf-ubuntu:latest
root@c6dee88f7ab6:/# exit
exit

Open issues:

  • Due to gcc-5 compilation errors I needed to disable the brcm WiFi drivers. So I have to figure out the root cause for these errors before enabling them again.
3 Likes

Hi, Uli:
First of all, thanks for your effort!

Can you post the compilation errors log, it seem that I’ve met this before, may be I can figure out a solution.

One question: why still run docker as ARMHF, as S905X is 64-bit processor, and the linux kernel also run as aarch64.

Another option of Docker run. Just install it from a network repository (docker.io).

https://forum.armbian.com/index.php?/topic/490-docker-on-armbian/&do=findComment&comment=26800

2 Likes

Yes I know, but this is the easy part. The harder part is building a custom kernel with aufs support and other necessary kernel options (if you cannot go for mainline). Igor pays much attention to shipping Armbian images with Docker ready kernels.

1 Like

I’ve fixed the compilation issues and enabled the brcm* drivers again.
How do I enable the build-in wifi module (bt already runs fine)?

  • Which kernel module do i have load?
  • Do I need special firmware blobs?
  • Do I have to initialize the HW in a particular way?
1 Like

All the latest images Armbian for Amlogic S9xxx, at the core of everything is already enabled for Docker. You only need to install “docker.io” the system by regular means (through synaptic or apt-get).

Hi Oleg,

at this time the ODROID-C2 is the only S905 board officially supported by the the Armbian team (and HK has added Docker support to their kernel tree). The Armbian build toolset is quite versatile, so with sources for u-boot and kernel it’s quite easy to build ready to use images for other boards. As your image is build out of tree, please point me to the source you’ve taken to build the kernel (and additional patches, if present). If you have used GitHub - khadas/linux: Linux kernel for Khadas VIMs & Edges the Docker service won’t start, although you will be able to install the package.

Cheers
Uli

Hi Gouwa,

I’ve updated the PR.

Cheers
Uli

Hi Oleg,

did you manage to build a mainline kernel for the KVIM?

Cheers
Uli