It looks like a tiny VM
docker run alpine /bin/sh- Its own filesystem, network, processes, limits
- Feels like a whole machine
FOSS Meet '26 · Container Workshop
webmaster · June 18, 2026
docker run alpine /bin/shThe root it can see, that can't corrupt the original
$ truncate -s 5G btrfs-disk.img$ mkfs.btrfs -f btrfs-disk.img$ mount -o loop btrfs-disk.img ./mnt$ btrfs subvolume snapshot base ./my-containerWrites hit the snapshot. The base image is never touched.
Give the process a private wire to the host
$ ip netns add netns_ctr$ ip link set veth_cont netns netns_ctrThe container's address is private — someone has to translate
$ iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADECap the blast radius
$ cgset -r cpu.weight=50 ctr$ cgset -r memory.max=536870912 ctr # 512 MBThe heart of the whole thing
unshare --pid --mount --uts --ipcchroot → the snapshot becomes /Read it from the outside in.
ps shows almost nothinghostname → my-containerping 8.8.8.8 works through the NATfree -m sees the 512 MB cap