Also see https://gist.github.com/pojntfx/6d81b9ebe8b801e024d81fa9f3f3a4b2 for a pet Alpine Linux in QEMU
# If you like to use Docker
docker run --privileged -it alpine:edge sh
apk add alpine-make-vm-image
cd /tmp
# Now add the files from below
alpine-make-vm-image --image-format qcow2 --image-size 250M --repositories-file ./repositories --packages "$(cat ./packages)" --script-chroot ./alpine.qcow2 ./configure.sh
# Copy to host
scp -P 10022 root@localhost:/tmp/alpine.qcow2 ~/Downloads/felix-pojtingers-alpine-linux-distribution.qcow2 # or `docker cp`
# Resize
qemu-img resize ~/Downloads/felix-pojtingers-alpine-linux-distribution.qcow2 +20G
# Launch on host (exit with CTRL - A - X)
qemu-system-x86_64 -accel hvf -m 2048 -nographic -nic user,hostfwd=tcp::20022-:22 -boot d -drive format=qcow2,file=$HOME/Downloads/felix-pojtingers-alpine-linux-distribution.qcow2
# Connect and resize filesystem
ssh -p 20022 root@localhost "resize2fs /dev/sda"
# Example: Run Theia in Docker
apk add docker
rc-update add docker
rc-service docker start
docker run -d -it -p 3000:3000 theiaide/theia:next
# Forward VM localhost:3000 to host 0.0.0.0:23000
ssh -p 20022 -L 0.0.0.0:23000:localhost:3000 root@localhost