Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: paulscode on May 21, 2017, 09:51:48 AM

Title: Dockerd on Tiny Core 8.0 x86 -- "overlay" not a supported filesystem
Post 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:

Code: [Select]
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:
Code: [Select]
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:
Code: [Select]
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)
Title: Re: Dockerd on Tiny Core 8.0 x86 -- "overlay" not a supported filesystem
Post by: Juanito on May 21, 2017, 10:06:25 AM
As per: http://tinycorelinux.net/8.x/x86/release/src/kernel/config-4.8.17-tinycore

Code: [Select]
# CONFIG_OVERLAY_FS is not set
..so you'll need to recompile the kernel
Title: Re: Dockerd on Tiny Core 8.0 x86 -- "overlay" not a supported filesystem
Post by: paulscode on May 21, 2017, 10:22:58 AM
Excellent, thanks for the help!
Title: Re: Dockerd on Tiny Core 8.0 x86 -- "overlay" not a supported filesystem
Post by: andyj on May 21, 2017, 10:58:09 AM
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...
Title: Re: Dockerd on Tiny Core 8.0 x86 -- "overlay" not a supported filesystem
Post by: hiro on May 21, 2017, 11:26:06 AM
andyj: clearly containers and VMs have overlapping but still different use cases
Title: Re: Dockerd on Tiny Core 8.0 x86 -- "overlay" not a supported filesystem
Post by: paulscode on May 21, 2017, 02:20:59 PM
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:

Code: [Select]
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?
Title: Re: Dockerd on Tiny Core 8.0 x86 -- "overlay" not a supported filesystem
Post by: andyj on May 21, 2017, 02:50:21 PM
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.
Title: Re: Dockerd on Tiny Core 8.0 x86 -- "overlay" not a supported filesystem
Post by: paulscode on May 21, 2017, 04:25:15 PM
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:

Code: [Select]
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:

Code: [Select]
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"
Title: [SOLVED] Dockerd on Tiny Core 8.0 x86 -- "overlay" not a supported filesystem
Post by: paulscode on May 21, 2017, 05:56:30 PM
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.
Title: Re: Dockerd on Tiny Core 8.0 x86 -- "overlay" not a supported filesystem
Post by: dcyran on May 22, 2017, 10:05:46 PM
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.
Title: Re: Dockerd on Tiny Core 8.0 x86 -- "overlay" not a supported filesystem
Post by: hiro on May 23, 2017, 07:19:26 AM
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.
Title: Re: Dockerd on Tiny Core 8.0 x86 -- "overlay" not a supported filesystem
Post by: fengzhibin on February 27, 2018, 09:56:36 AM
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

Code: [Select]
# CONFIG_OVERLAY_FS is not set
..so you'll need to recompile the kernel
Title: Re: Dockerd on Tiny Core 8.0 x86 -- "overlay" not a supported filesystem
Post by: fengzhibin on February 27, 2018, 09:59:12 AM
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!
Title: Re: Dockerd on Tiny Core 8.0 x86 -- "overlay" not a supported filesystem
Post by: Juanito on February 27, 2018, 10:55:53 AM
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:
Code: [Select]
$ 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"
Title: Re: Dockerd on Tiny Core 8.0 x86 -- "overlay" not a supported filesystem
Post by: fengzhibin on February 27, 2018, 11:19:45 PM
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)
Title: Re: Dockerd on Tiny Core 8.0 x86 -- "overlay" not a supported filesystem
Post by: Juanito on February 28, 2018, 12:38:45 AM
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?
Title: Re: Dockerd on Tiny Core 8.0 x86 -- "overlay" not a supported filesystem
Post by: aw on March 06, 2018, 09:07:30 PM
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.
Title: Re: Dockerd on Tiny Core 8.0 x86 -- "overlay" not a supported filesystem
Post by: hiro on March 07, 2018, 06:05:19 PM
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.
Title: Re: Dockerd on Tiny Core 8.0 x86 -- "overlay" not a supported filesystem
Post by: webb on August 09, 2019, 05:21:04 AM
You can run dockerd without a custom kernel: http://forum.tinycorelinux.net/index.php/topic,21839.msg144726.html#msg144726