Skip to content

innovarew/docker-tinycore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub license GitHub Release Date GitHub top language Docker build Docker publish GitHub file size in bytes

docker-tinycore

Docker from scratch image of Tinycore Linux

Quick guide

To build on top of it, just pull from the docker-tinycore package

echo FROM ghcr.io/innovarew/docker-tinycore > Dockerfile
docker build -t docker-tinycore-scratch .

To run, just docker run as show below:

sudo docker run -it ghcr.io/innovarew/docker-tinycore:latest

To build locally, just make as show below:

# prepare the rootfs, build, and run the container
sudo make TC_URL=http://tinycorelinux.net/15.x/x86_64/

Supported versions

Ready to use docker images from docker-tinycore (see link on how-to use):

Release/Arch Docker Image
latest FROM ghcr.io/innovarew/docker-tinycore:latest
15.x-x86_64 FROM ghcr.io/innovarew/docker-tinycore:15.x-x86_64
14.x-x86_64 FROM ghcr.io/innovarew/docker-tinycore:14.x-x86_64
14.x-x86 FROM ghcr.io/innovarew/docker-tinycore:14.x-x86
13.x-x86_64 FROM ghcr.io/innovarew/docker-tinycore:13.x-x86_64
12.x-x86_64 FROM ghcr.io/innovarew/docker-tinycore:12.x-x86_64
11.x-x86_64 FROM ghcr.io/innovarew/docker-tinycore:11.x-x86_64
10.x-x86_64 FROM ghcr.io/innovarew/docker-tinycore:10.x-x86_64

Detailed steps

What goes on under the hood is shown below:

cat > Dockerfile <<EOF
FROM scratch
ADD data/rootfs-x86_64-15.x.tar.xz /
EOF

# unpack tinycore rootfs, sudo needed to unpack cpio proper perms
sudo scripts/tc-docker tce_rootfs_init data/

# build and run the tinycore docker container
sudo docker build -t docker-tinycore-local:latest .
sudo docker run -it docker-tinycore-local:latest /bin/sh

Overview

tc-docker provides the main functionalities for running tinycore on docker:

  • First, provides tc-docker tce_rootfs_init that extracts the rootfs of a tinycore ISO image. This rootfs, can then be used on a Dockerfile, using FROM scratch and adding the rootfs.

  • Second, provides tc-docker tce_install ext.tcz root/, that fetches a ext.tcz and unpacks it under root/. This allows to install squashfs-tools.tcz, so the running container can use unsquashfs to install tcz extensions into the designated root/.

  • Last, once tinycore rootfs, and, unsquashfs are in place inside the container, the tce-load -wi whois command can be used on the running container to install new extensions.

One limitation of this approach is that if for any reason the unsquashfs stops working, say squashfs-tools.tcz or any of its dependences is removed then, tce-load stops working, and the ability of installing new tce extensions is lost.

A benefit of using the TinyCore ISO image as source, is that extensions shipped inside the TinyCore ISO under <iso>/cde are available, and can be provided as a docker volume to be used for shipping as offline extensions without requiring download.