Posts

Showing posts with the label cloud

Bootstrapping Alpine Linux QCow2 image

Introduction Alpine Linux is a minimal distro with package manager ( APK ) that is based on busybox and musl library . Like the  CirrOS , it's very lightweight, but unlike it, it's full featured. In case you don't know me, my Linux distro of choice is Fedora/CentOS, in this post I'm going to bootstrap a QCow2 cloud image of Alpine Linux on my distro of choice. Using docker to bootstrap a working chroot Type mkdir alpine35-root docker run --rm -ti -v $PWD/alpine35-root:/data alpine:3.5 apk --arch x86_64 -X http://nl.alpinelinux.org/alpine/v3.5/main/ -U --allow-untrusted --root /data --initdb add alpine-base  and you should get a line like this OK: 6 MiB in 16 packages so now we have a working alpine chroot in the directory alpine35-root Creating Bootable QCoW2 Image Because I don't want to format my hard disk by mistake and because I know Murphy's law, I'll take those 6MB as tarball and continue on a VM. dd if=/d...

playing with "unc" the unprivileged user containers

Image
Introduction If you are familiar with docker then you are going to love this little hack. UNC  is a tool to demonstrate how to launch containers without being root. Getting the code and compiling it git clone https://github.com/LK4D4/unc.git cd unc mkdir -p gopath/src/ ln -s ../.. gopath/src/unc export GOPATH=$PWD/gopath cd gopath/src/unc go get go build cd unet go build cd .. sudo cp unc unet/unet /usr/local/bin/ sudo chmod u+s /usr/local/bin/unet What is SetUID for? "unet" is a tool used "unc" that creates veth pairs and assign one of them to container. Root user (via setuid) is needed to be able to assign a network interface for the user container. Creating some minimal root filesystems sudo dnf install busybox # as regular unprivileged user type mkdir -p roots/busybox1/{bin,sbin,proc,dev,etc} cp /sbin/busybox roots/busybox1/sbin/ echo "root:x:0:0:root:/root:/bin/bash" > roots/busybox1/etc/passwd echo "r...

Be aware! Docker is a trap.

Image
UPDATE: docker inc. addressed those concerns by donating its runtime to Cloud Native Computing Foundation  (CNCF) and by making moby a community project. Yes, I'm  claiming that Docker is just a hyped vendor lock-in. Don't get me wrong, Linux containers, micro-services, DevOPs,... are all very cool and they are cool for a reason. On the other hand docker is just an overrated vendor lock-in. Linux containers is a new term for old technologies like namespace and control groups, used in production maybe for more than a decade. LXC is one way to access those kernel feature in a boring way. OpenVZ and the newly hyped LXD is virtualization hypervisor based on Linux containers. SystemD do use containers for all of spawned services and can be used to spawn containers (using nspawn ). In other words Docker did not invent containers. I was warned about that more than a year ago but then it was not that obvious. What's wrong with docker? So many things! At every sing...