I have built a 32 bit version of Docker daemon and client, and I am now attempting to configure Tiny Core 8.0 x86 to run these.
I have resolved most of the problems by installing a few missing dependencies, rebuilding the kernel after enabling a couple of missing flags, and symlinking the persistent storage location to a folder under /mnt/sda1. 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 Tiny Core
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. So the pivot_root problem should hopefully be the final hurdle to getting this system working.
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). This may be more of a conversation for me to have with the Docker community, but thought I would post here to see if anyone has some ideas.
It is also possible that I have completely misdiagnosed the problem, so feel free to call me an idiot