TinyCore 8.0 x86 - pivot_root invalid argument

I have built a 32 bit version of Docker daemon and client as described HERE. I have tested and verified that they function properly on Alpine x86. I am now attempting to configure Tiny Core 8.0 x86 to run these, as it is lighter-weight and much faster boot-up.

I have resolved most of the problems by installing a few missing dependencies and rebuilding the kernel after enabling a couple of missing flags. At this point, the Docker daemon starts up without any errors. When I try to run the following test:

docker run -it 32bit/ubuntu:16.04 /bin/echo Hello World

It retrieves the image from DockerHub, but fails with the following error:

docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "process_linux_go:359: container init caused \"rootfs_linux.go:90: jailing process inside rootfs caused \\\"pivot_root invalid argument\\\"\"".

The test will run successfully, however, if I set environment variable DOCKER_RAMDISK to true, which sets the no pivot option on runc. Any thoughts on how to address the problem without using this workaround? I unfortunately don’t understand enough about pivot_root or the differences between Tiny Core and Alpine to diagnose the problem myself.

For reference, output of docker version:

Client:
  Version:      17.04.0-ce
  API version:  1.28
  Go version:   go1.7.5
  Git commit:   4845c56
  Built:        Sat May 20 01:51:44 2017
  OS/Arch:      linux/386
Server:
  Version:      17.04.0-ce
  API version:  1.28 (minimum version 1.12)
  Go version:   go1.7.5
  Git commit:   4845c56
  Built:        Sat May 20 01:51:44 2017
  OS/Arch:      linux/386
  Experimental: false

For reference, there are also the following warnings when Docker daemon starts (I’m guessing these can probably be fixed with the proper kernel config updates). These are also present on Alpine which does not have the problem with pivot_root, so guessing they are not relevant, but posting them just in case.

WARN[0001] Your kernel does not support cgroup memory limit
WARN[0001] Your kernel does not support cgroup blkio weight
WARN[0001] Your kernel does not support cgroup blkio weight_device
WARN[0001] Your kernel does not support cgroup blkio throttle.read_bps_device
WARN[0001] Your kernel does not support cgroup blkio throttle.write_bps_device
WARN[0001] Your kernel does not support cgroup blkio throttle.read_iops_device
WARN[0001] Your kernel does not support cgroup blkio throttle.write_iops_device

I suspect the issue is related to the fact that TinyCore runs in RAM. I tried symlinking /var/lib/docker to a mounted physical drive. The docker images now persist across sessions, but I’m still getting the error about pivot_root invalid argument. Not sure what to try next.

Doing a little reading into kernel documentation, I came across an article entitled ramfs, rootfs and initramfs. The apparently relevant information from that article:

When switching another root device, initrd would pivot_root and then umount the ramdisk. But initramfs is rootfs: you can neither pivot_root rootfs, nor unmount it

I have also found this reiterated in several other sources as well. Summary of the main points:

  • initrd is loaded into ramdisk which is an actual file system.
  • initramfs is not a file system.
  • For initrd pivot_root is used and for initramfs switch_root is used.
  • You can not use pivot_root on an initramfs rootfs, you will get Invalid Argument. You can only pivot real file systems.

This is unfortunately very new territory for me (I’m fairly new to linux, so I’m still getting familiar with the various technologies and vocabulary).