[HowTo] Docker and Grinch 21.3.3

How to for use Docker with Grinch Kernel 21.3.3

Read first:

I do not know if this is to be, but after installing Docker, Jetson effectively uses only one cpu core. Please advise whether it should be . Maybe it’s a matter of cgroup-lite package!

Requirments:

  • The Grinch Custom Kernel 21.3.3 or above
  1. Install software
sudo apt-get install lxc aufs-tools cgroup-lite apparmor docker.io
  1. Check docker installation
sudo docker info
Containers: 0
Images: 0
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Dirs: 0
Execution Driver: native-0.2
Kernel Version: 3.10.40-grinch-21.3.3
  1. Find image
sudo docker search armhf-
NAME                                    DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
armv7/armhf-ubuntu                      'official' Ubuntu Docker images for the AR...   5                    
mazzolino/armhf-debian                  Debian Wheezy base image for armhf devices      4                    
mazzolino/armhf-ubuntu                  Ubuntu-Core images for armhf (ARMv7) devices    4                    
armv7/armhf-archlinux                   archlinux arm Docker image for the ARMv7(a...   3                    
hominidae/armhf-ubuntu                  ubuntu trusty/14.04 image (minbase) for ar...   2                    
armv7/armhf-ubuntu_core                 Ubuntu Core Docker images for the ARMv7(ar...   2                    
armv7/armhf-fedora                      minimal fedora 21, 20 Docker images for th...   1                    
hominidae/armhf-wheezy                  armhf image of Debian Wheezy, made with de...   1                    
armbuild/ubuntu-debootstrap             ARMHF port of ubuntu-debootstrap                1                    [OK]
rcarmo/armhf-ubuntu                     Ubuntu 14.04.2 for armhf devices                0                    
mazzolino/armhf-nginx                   Nginx image for armhf devices                   0                    
troyfontaine/armhf-nginx                Nginx for ARMHF                                 0                    
dpniel/dekko-armhf                      armhf utopic image to build dekko click pa...   0                    
kickinz1/owncloud-8.0.2-sqlite3-armhf   Owncloud armhf image for snappy use             0                    
hominidae/armhf-supervisord             ubuntu trusty/14.04 for armhf architecure ...   0                    
dehy/armhf-swarm                        ARMHF port of docker-swarm                      0                    
moul/armhf-busybox                                                                      0                    [OK]
flisboac/docker-armhf-phabricator                                                       0                    [OK]
kickinz1/ubuntu-armhf                   Base image for ubuntu trusty on armhf           0                    
armv7/armhf-baseimage                   Ubuntu Docker images for the ARMv7(armhf) ...   0                    
mazzolino/armhf-prosody                 Secured Prosody XMPP server for armhf (ARM...   0                    
dehy/armhf-couchdb                      ARMHF port of klaemo/couchdb                    0                    
eagos/node-armhf                        Node JS for armhf devices.                      0                    
mazzolino/armhf-tiddlywiki              Tiddywiki5 on NodeJS for armhf (ARMv7) dev...   0                    
zsoltm/ubuntu-armhf                     Ubuntu 14.04.1 minimal install, latest upd...   0
  1. Run/download image
sudo docker run armv7/armhf-ubuntu_core /bin/echo 'Hello world'
Unable to find image 'armv7/armhf-ubuntu_core' locally
Pulling repository armv7/armhf-ubuntu_core
ffb007497c55: Download complete 
Hello world
  1. List images
sudo docker images
REPOSITORY                TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
armv7/armhf-ubuntu_core   latest              ffb007497c55        2 days ago          108.4 MB

Thank you for your effort.

I’m getting these errors:

E: Unable to locate package aufs-tools
E: Unable to locate package docker.io
E: Couldn’t find any package by regex ‘docker.io

Can you help to get around these?

Thanks.

I haven’t used docker, but I do see there is a package “docker.io” found by “apt search docker”. Not sure which repository it is in. The same is true for search of aufs-tools. If you are using apt or package tools of some sort to find the app and it doesn’t show up, then you’re just missing the repository in /etc/apt/sources.list.

Try

sudo add-apt-repository universe
sudo add-apt-repository multiverse

Also for restricted content:

sudo add-apt-repository restricted

than

sudo apt-get update

and now you should install this packages.

Or in software-properties-gtk … you can enable this in first tab, also backports (third tab: trusty-backports)

Than update software list and try to install your apps.

Hi all,

I’m having the same problem with a Jetson TK1: inside docker containers only one CPU is usable.

On the host system I get:

cat /sys/fs/cgroup/cpuset/cpuset.cpus
0-3

But inside the container it is always only one cpu:

cat /sys/fs/cgroup/cpuset/cpuset.cpus
0

Did anyone find out where the problem is here?

System info:

Kernel: 3.10.40-grinch-21.3.4
Docker info:

Containers: 11
 Running: 1
 Paused: 0
 Stopped: 10
Images: 6
Server Version: 1.11.0
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 68
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: bridge null host
Kernel Version: 3.10.40-grinch-21.3.4
Operating System: Ubuntu 14.04.5 LTS
OSType: linux
Architecture: armv7l
CPUs: 4
Total Memory: 1.844 GiB
Name: rc-ci-jetson-tk1
ID: 7DOB:7N5D:4KF7:2TI4:JGX2:QRXF:AYAK:EUHV:BWUJ:N2OA:5ZKB:E56E
Docker Root Dir: /var/lib/docker
Debug mode (client): false
Debug mode (server): false
Registry: https://index.docker.io/v1/

Any info would be very appreciated!

That file in (“/sys/fs/cgroup/cpuset/cpuset.cpus”) does not exist on a JTK1 by default. I don’t know which kernel feature produces this, but I suspect it would work with the correct kernel config. Does docker come with any listing of required kernel drivers or config?

It does exist with the 3.10.40-grinch-21.3.4 kernel as I posted…

And yes docker has a script to check kernel support: moby/check-config.sh at master · moby/moby · GitHub

But that was not the issue, the needed options are supported by that kernel and docker was running fine, just using one of the 4 cores though…

In any case I found the solution:

Make sure all CPUs are always on:

echo 1 > /sys/devices/system/cpu/cpu0/online
echo 1 > /sys/devices/system/cpu/cpu1/online
echo 1 > /sys/devices/system/cpu/cpu2/online
echo 1 > /sys/devices/system/cpu/cpu3/online

and allow docker to use all of them

echo 0-3 > /sys/fs/cgroup/cpuset/docker/cpuset.cpus

only cpu 0 was allowed here before…, maybe because only the small CPU was active at startup when the cgroup fs was populated…

If you are interested in permanently stopping some of the init scripts from overriding your performance settings you may want this (sometimes you’ll change a performance setting and then it’ll mysteriously reset itself…this removes the init script side of undoing your settings…don’t use it if battery life matters):

sudo update-rc.d -f ondemand remove

Locking thread, please create another thread if any further issues are found.