Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started by: paulscode on May 21, 2017, 09:51:48 AM
-
QUESTION
When I attempt to run the Docker Daemon in Tiny Core 8.0, it generates an error stating that 'overlay' is not a supported filesystem on the host. Is there a package that can be installed which will meet this dependency? Searching for the term "overlay" in the Apps cloud did not return any obvious results.
ADDITIONAL DETAILS
I have build 32bit versions of Docker Daemon and Docker Client following the instructions described HERE (http://www.nirmata.com/2016/02/docker-daemon-for-x32-architectures/). 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.
For my test environment, I installed Tiny Core x86 in VirtualBox from the CorePlus-8.0.iso image, with options: "Frugal", "Whole Disk", "sda", "Install Boot Loader", "ext4", "Core and X/GUI Desktop".
After booting up for the first time, I then ran the following commands to install dependencies and set up the environment:
tce-load -wi bash git procps xz ca-certificates iptables net-bridging-4.8.17-tinycore
sudo ln -s /usr/local/etc/ssl /etc/ssl
sudo addgroup docker
sudo addgroup tc docker
echo "etc/passwd" >> /opt/.filetool.lst
echo "etc/group" >> /opt/.filetool.lst
echo "etc/shadow" >> /opt/.filetool.lst
echo "etc/gshadow" >> /opt/.filetool.lst
echo "etc/profile.d" >> /opt/.filetool.lst
echo "etc/ssl" >> /opt/.filetool.lst
echo "#!/bin/bash" >> /etc/profile.d/paths.sh
echo "export PATH=\$PATH:/home/tc/dockerd:/home/tc/docker" >> /etc/profile.d/paths.sh
chmod 755 /etc/profile.d/paths.sh
cd ~
mkdir dockerd
mkdir docker
cd ~/dockerd
wget http://www.paulscode.com/downloads/dockerd.zip
unzip dockerd.zip
wget https://raw.githubusercontent.com/tianon/cgroupfs-mount/master/cgroupfs-mount
chmod 755 cgroupfs-mount
cd ~/docker
wget http://www.paulscode.com/downloads/docker.zip
unzip docker.zip
After rebooting, I am then able to launch the Docker Daemon without it crashing:
sudo cgroupfs-mount
sudo dockerd
(http://www.paulscode.com/images/tinycore_dockerd.png)
As you can see from the output, although the Docker Daemon runs, there is an error stating that 'overlay' is not a supported filesystem on the host.
When I run a simple test:
docker run -it 32bit/ubuntu:16.04 /bin/echo Hello World
Docker crashes with a message about insufficient disk space. Since the same test works on Alpine x86, I suspect the problem is related to the error about 'overlay' filesystem. I would like to address this error first to rule it out as the cause.
For reference, output of the same test on Alpine x86. As you can see, it is nearly identical to the output from TinyCore, but doesn't have the error about 'overlay' filesystem:
(http://www.paulscode.com/images/alpine_dockerd.png)
-
As per: http://tinycorelinux.net/8.x/x86/release/src/kernel/config-4.8.17-tinycore
# CONFIG_OVERLAY_FS is not set
..so you'll need to recompile the kernel
-
Excellent, thanks for the help!
-
It seems to me that the docker model of apps in containers on one kernel is a lot like the hypervisor type 1 model of VMs, except that in theory the containers are smaller than VM's. This might be true if the VM's are running Windows or Ubuntu or RHEL or SLES, but if the VM's are TC then that difference mostly goes away. You're left with the host OS of docker which unless it's TC then it's bigger than ESXi for example. Recompiling the kernel to support docker on TC might solve that problem, but it seems like the separation might still be better in VM's. It sounds like a lot of work for what might turn out to be a wash resource wise.
After all that I would also like to see overlayfs support, but for a different reason. I'd also like to see TC based on LTS kernels too, but I digress...
-
andyj: clearly containers and VMs have overlapping but still different use cases
-
I apologize for the dumb questions, but this is my first experience building a kernel. I made the config changes and built the tinycore kernel, but now not sure what the next steps should be. If I have a tinycore installation, how to I replace the vanilla kernel with this modified one?
For reference, here is the process I followed to build the kernel:
I began by spinning up a fresh 32bit Ubuntu image, and installed build-dep libncurses5-dev and libncursesw5-dev
Then I ran the following commands:
wget http://tinycorelinux.net/8.x/x86/release/src/kernel/linux-4.8.17-patched.txz
wget http://tinycorelinux.net/8.x/x86/release/src/kernel/config-4.8.17-tinycore
tar -xvf linux-4.8.17-patched.txz
cp config-4.8.17-tinycore linux-4.8.17/.config
cd linux-4.8.17
gedit .config
CONFIG_OVERLAY_FS=y
# (plus these two to address some of the other dockerd warnings)
CONFIG_MEMCG=y
CONFIG_CFS_BANDWIDTH=y
make oldconfig
make menuconfig
make bzImage
This eventually completes with the message "Kernel: arch/x86/boot/bzImage is ready". At this point I am not sure what to do next. Do I just need to take that file and overwrite its counterpart on the existing tinycore installation, or are there other steps?
-
The bzImage file you made in linux-4.8.17/arch/x86/boot is your kernel. Copy it to your system's boot directory with the other kernels (renaming it as necessary) and copy the existing menu entry in your boot loader for TC to make a new entry using your new kernel. You shouldn't have to change any other entries. You can use the same rootfs and modules. I wouldn't overwrite an existing working entry, but that depends on your confidence level. Good luck.
-
Thanks again for the help. Booting with the new kernel generates a lot of error messages and freezes. The messages zoom by too fast to read, and I can't scroll back up to see them. I'll try and rebuild the kernel without any config changes, to rule out problems with the build process. I'll also see if I can take a video of the VM as it is booting up and step through the frames to try and read the error messages.
For reference, I used the following commands to add the new kernel to the boot directory:
cd /mnt/sda1/tce/boot
wget http://www.paulscode.com/downloads/bzImage
chmod 664 bzImage
cd extlinux
vi extlinux.conf
I edited extlinux.conf like so:
DEFAULT bzim
LABEL core
KERNEL /tce/boot/vmlinuz
INITRD /tce/boot/core.gz
APPEND quiet waitusb=5:UUID="fee3c2ac-3bf2-4aa1-ae8e-73fa95f4ea2c" tce=UUID="fee3c2ac-3bf2-4aa1-ae8e-73fa95f4ea2c"
LABEL bzim
KERNEL /tce/boot/bzImage
INITRD /tce/boot/core.gz
APPEND quiet waitusb=5:UUID="fee3c2ac-3bf2-4aa1-ae8e-73fa95f4ea2c" tce=UUID="fee3c2ac-3bf2-4aa1-ae8e-73fa95f4ea2c"
-
Building the kernel with no config changes was successful, so I built it with only the CONFIG_OVERLAY_FS parameter set (without the other two config changes). This build booted up successfully, and the Docker Daemon starts without errors.
There are some new errors to fix when I try to launch the Docker Client, but I'll mark this thread as solved since the "overlay not a supported filesystem" issue is resolved.
-
hi
my small imput: as I understand, alpine x86 is compiled with musl -not libc (TinyCore and most distributions). This could be one more factor for the issues.
-
deyran: no, the only interface between the container "guest" and the host is through the kernel. we don't use the host's libc inside the container and musl can be used just fine.
-
I am a Linux novice, can you tell me how to recompile the kernel? I want to recompile the kernel of x86_64's corepure, or can I have a tutorial to point it out
As per: http://tinycorelinux.net/8.x/x86/release/src/kernel/config-4.8.17-tinycore
# CONFIG_OVERLAY_FS is not set
..so you'll need to recompile the kernel
-
Can you share how to recompile the kernel? When I install docker, I also encounter the same confusion as you, and I need a x86_64 bit system. I also need to install docker-compose. But I have to run dockerd first, so I also need to recompile the kernel to open CONFIG_OVERLAY_FS
Excellent, thanks for the help!
-
Using:
http://repo.tinycorelinux.net/9.x/x86_64/release/src/kernel/linux-4.14.10-patched.txz
http://repo.tinycorelinux.net/9.x/x86_64/release/src/kernel/config-4.14.10-tinycore64
..something like this: $ tce-load -i compiletc perl5 bash ncurses-dev bc advcomp glibc_apps
$ cd linux-4.14.10
$ make mrproper
$ cp ../config-4.14.10-tinycore64 .config
$ make oldconfig
..then use "make menuconfig" to make your changes and, once done, "make"
-
OK, thank you. I want to integrate the new kernel into the ISO image. Do I follow this document? http://wiki.tinycorelinux.net/wiki:remastering (http://wiki.tinycorelinux.net/wiki:remastering)
-
I haven't checked, but if CONFIG_OVERLAY_FS can be set to "m" then perhaps you can get away with including the module(s) produced in an extension?
-
I have a public repo with files and scripts for compiling a TinyCore kernel.
https://github.com/on-prem/tinycore-kernel (https://github.com/on-prem/tinycore-kernel)
The latest one I posted there (4.9.66) contains the correct config for overlayfs (Docker) support.
The build instructions are in the README.md. Please read it carefully.
-
It might be better to update the wiki in case additional instructions are indeed necessarry. I don't like the idea that documentation is limited to a third party github repository.
Also the instructions there seem to suggest you'd have to use files from the github repository, while we are hosting the source files via very accessible http links. I don't like stuff scattered like this, it also creates a useless trust issue.
-
You can run dockerd without a custom kernel: http://forum.tinycorelinux.net/index.php/topic,21839.msg144726.html#msg144726