[OFFICIAL] Docker support


#1

Docker on Online Labs’ C1

We added two preconfigured images with Docker and compiled the kernel with missing modules.



[OFFICIAL] New linux distributions (Debian, CoreOS, CentOS, Fedora, Arch Linux, ...)
[resolved] Is it possible to provide a docker enabled image?
#5

Can you guys get progrium/busybox to work? It’s a busybox image with glibc+opkg so you can easily install common packages.


#6

From what I see, we need at least two modifications :

1: He build the image using a second one that create a buildroot based rootfs, we need to tell it to compile on armhf

2: Then he use two i386 binaries


we need to find an armhf version of these binaries

I will give a try later, but you can try by yourself


#7

Thanks for reply manfred.

I am still a bit raw in my Dockerfile skills but I will look if the packages are available for armhf.


#8

Good news, we successfully ran an x86_64 Docker image

We used the binfmt kernel module to register the that ELF-magic binaries will run through qemu-x86_64-static !
Then we need to have the qemu-x86_64-static in the Docker image

  • Built from the Dockerfile
  • or mounted through the -v argument of docker run at the runtime

root@c1-10-1-15-49:~# uname -a
Linux c1-10-1-15-49 3.17.0-96 #10 SMP Thu Oct 23 16:26:47 CEST 2014 armv7l armv7l armv7l GNU/Linux

root@c1-10-1-15-49:~# cat /proc/sys/fs/binfmt_misc/qemu-x86_64
enabled
interpreter /usr/bin/qemu-x86_64-static
flags: OC
offset 0
magic 7f454c4602010100000000000000000002003e00
mask fffffffffffefefffffffffffffffffffeffffff

root@c1-10-1-15-49:~# docker run --rm -itv /usr/bin/qemu-x86_64-static:/usr/bin/qemu-x86_64-static 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.
    (Assuming it was not already locally available.)
 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

For more examples and ideas, visit:
 http://docs.docker.com/userguide/
root@c1-10-1-15-49:~#

Demo without Docker

We are on arm architecture

root@c1-10-1-15-49:~# uname -a
Linux c1-10-1-15-49 3.17.0-96 #10 SMP Thu Oct 23 16:26:47 CEST 2014 armv7l armv7l armv7l GNU/Linux

File is an x86-64 ELF executable

root@c1-10-1-15-49:~# file hello
hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, corrupted section header size

We can run the executable with emu-x86_64-static

root@c1-10-1-15-49:~# /usr/bin/qemu-x86_64-static ./hello

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.
 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 Hub account:
 http://hub.docker.com

For more examples and ideas, visit:
 http://docs.docker.com/userguide/

Thanks to the binfmt kernel module and proper configuration, we can run ./hello without passing it to qemu-x86_64-static

root@c1-10-1-15-49:~# ./hello

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.
 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 Hub account:
 http://hub.docker.com

For more examples and ideas, visit:
 http://docs.docker.com/userguide/

root@c1-10-1-15-49:~#

#9

Can’t run postgres ?

docker run --name db -d postgres
2014/11/03 21:42:56 Error response from daemon: Cannot start container 2418eb59fcaf454979c9dc13b326d8ff23c027bce8131521b34971a9752c7448: exec format error

curl https://raw.githubusercontent.com/docker/docker/master/contrib/check-config.sh | bash

- Storage Drivers:
  - "aufs":
    - CONFIG_AUFS_FS: missing

#10

You are trying to run an x86_64 postgres image.


Please read the following post (talking about docker on armhf specifics)


PS: I’m building some armhf postgres images right now, but not the official one that depends on the official postgresql repository that only contains i386/x86_64 pre-compiled packages.


#11

We are currently testing a kernel with AUFS support, the performances seems much higher. We should launch this kernel publicly this week.


#12

When do you plan to upgrade the image to Docker Engine 1.11?