WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Docker  (Read 12927 times)

Offline Carsten

  • Newbie
  • *
  • Posts: 21
Docker
« on: April 01, 2018, 03:26:44 AM »
Hi,

I hope I'm not missing the obvious. I googled for this quite a lot but didn't find anything relevant.

Is it possible to install docker in TCL x64? I'm using TCL in VirtualBox for various things and I would like to also use it for Docker. Means, docker WITHIN TCL, rather than TCL as a Container. I don't want to use the docker-machine or the Toolbox, since I want to keep the host machine untouched as far as possible.

I found a post talking about a docker.tcz for TCL 5.0, but that is quite a number of years ago and I couldn't find anything after that.

Is there any way to get Docker working in TCL x64, so that I can run Containers from there?

Regards

Carsten


Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Docker
« Reply #1 on: April 01, 2018, 03:47:43 AM »

Offline Carsten

  • Newbie
  • *
  • Posts: 21
Re: Docker
« Reply #2 on: April 05, 2018, 12:33:48 AM »
Hi Juanito,

I did. He started off with building docker. Unfortunately, I'm not into that and I'm far away from dealing with gcc etc.

I was hoping there was something available. Not necessarily a ready made tcz, but if there was a distribution pack I could download from somewhere which could run on TCL, I'd be happy to go with that.

Would you know of anything?

Regards

Carsten

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Docker
« Reply #3 on: April 05, 2018, 01:16:45 AM »
You could pm @paulscode and ask for a copy of the docker extension he had working?

Offline Carsten

  • Newbie
  • *
  • Posts: 21
Re: Docker
« Reply #4 on: April 06, 2018, 08:13:37 AM »
Hi Juanito,

I did PM him, but no response.

Nevertheless, I managed to build a new image with CONFIG_OVERLAY_FS enabled and CONFIG_OVERLAY_FS_REDIRECT_DIR and CONFIG_OVERLAY_FS_INDEX as well (since in the "make bzImage" asked for it).

Docker (18.03.0-ce) is now getting beyond the OVERLAY complaint (so the new boot image is working ok), but now I'm getting stuck at errors saying, that cgroups is not mounted. I saw in other posts that cgroups are being reported as being initialized, but I can't find anything in my dmesg.

I checked the .config file and almost everything concerning cgroups is activated.

I'm running the latest corepure64 in VirtualBox and I tried KVM as well as HyperV, but that didn't make any difference. Is there anything else I need to activate in the .config file?

Regards

Carsten

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Docker
« Reply #5 on: April 08, 2018, 06:43:02 AM »
sorry, but I don't very much about this kind of thing  :(

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Docker
« Reply #6 on: April 08, 2018, 08:45:49 AM »
Hi Carsten
Just a few thoughts:

Quote
Nevertheless, I managed to build a new image with CONFIG_OVERLAY_FS enabled and CONFIG_OVERLAY_FS_REDIRECT_DIR and CONFIG_OVERLAY_FS_INDEX as well (since in the "make bzImage" asked for it).
You followed Juanitos instructions from here:
http://forum.tinycorelinux.net/index.php/topic,21079.msg136147.html#msg136147
Especially the part that reads:
..then use "make menuconfig" to make your changes and, once done, "make"
I ask because in this post:
http://forum.tinycorelinux.net/index.php/topic,21079.msg131677.html#msg131677
paulscode is using an editor to make changes to the config file, which is a bad idea. The configuration option you change
may depend on other options, or be a dependency of other options. Using  make menuconfig  for your changes resolves
any dependencies for you.

Quote
I'm running the latest corepure64 in VirtualBox and I tried KVM as well as HyperV, but that didn't make any difference. Is there anything else I need to activate in the .config file?
Have you tried running on bare metal to make sure the virtualization isn't causing any issues?

Quote
I saw in other posts that cgroups are being reported as being initialized, but I can't find anything in my dmesg.
This appears to be well written and is worth looking at:
https://0xax.gitbooks.io/linux-insides/content/Cgroups/linux-cgroups-1.html

Quote
... but now I'm getting stuck at errors saying, that cgroups is not mounted.
If you post the exact error messages someone might be able to provide some insight as to the cause.

Offline webb

  • Jr. Member
  • **
  • Posts: 52
Re: Docker
« Reply #7 on: August 08, 2019, 08:28:28 AM »
@carsten, it is possible to run dockerd and docker containers in TC x86_64 10.x without either rebuilding the kernel or building a tiny core package. I am doing it right now. Docker's documentation reveals that a kernel with overlay is required for docker only when using the default docker filesystem, but not if you use, e.g., btrfs for your docker filesystem.

1. These are required for docker:
Code: (bash) [Select]
net-bridging-4.19.10-tinycore64.tcz
iptables.tcz
openssl.tcz
ca-certificates.tcz

2. And these are required for btrfs:
Code: (bash) [Select]
raid-dm-4.19.10-tinycore64.tcz
filesystems-4.19.10-tinycore64.tcz

3. And this is required once to create a new btrfs volume:
Code: (bash) [Select]
btrfs-progs.tcz
4. Create a btrfs volume. (May require a bit of research.)

5. Create /etc/docker/daemon.json:
Code: (bash) [Select]
{
  "storage-driver": "btrfs"
}

6. Download this cgroupfs-mount script:
Code: (bash) [Select]
wget https://raw.githubusercontent.com/tianon/cgroupfs-mount/master/cgroupfs-mount
chmod 755 cgroupfs-mount

7. Do these:
Code: (bash) [Select]
sudo ln -s /usr/local/etc/ssl /etc/ssl
sudo addgroup docker
sudo addgroup tc docker

8. Add these to /opt/.filetool.lst:
Code: (bash) [Select]
/etc/passwd
/etc/group
/etc/shadow
/etc/gshadow
/usr/local/etc/ssh
/etc/docker/daemon.json

9. Use filetool.sh to backup the paths in .filetool.lst:
Code: (bash) [Select]
filetool.sh -b
10. Add this to /opt/bootlocal.sh or /opt/bootsync.sh:
Code: (bash) [Select]
modprobe btrfs
mkdir -p /var/lib/docker
mount <partition with your new btrfs volume> /var/lib/docker
export DOCKER_RAMDISK=true
ulimit -Hn 65535
ulimit -Sn 65535
/path/to/your/cgroupfs-mount
/path/to/your/dockerd >/home/tc/dockerd.log 2>&1 &

11. reboot and try
Code: (bash) [Select]
docker run hello-world :D

As a side-benefit, containers run faster than on Ubuntu because of missing dependencies that docker normally uses to throttle the containers.

(refs:  I borrowed some code from the first two code blocks of @paulscode)
« Last Edit: August 08, 2019, 08:34:27 AM by webb »

Offline mocore

  • Hero Member
  • *****
  • Posts: 506
  • ~.~
Re: Docker
« Reply #8 on: August 09, 2019, 11:13:45 AM »
it is possible to run dockerd and docker containers in TC x86_64 10.x without either rebuilding the kernel or building a tiny core package.
...
As a side-benefit, containers run faster than on Ubuntu because of missing dependencies that docker normally uses to throttle the containers.

8)
 conversely i just happened to have found this https://hub.docker.com/r/tatsushid/tinycore/ "tcl Docker Image" page