Install RunCVM and then launch an Alpine Container VM

by struanb
GNU/Linux ◆ xterm 158 views

Install RunCVM and launch an Alpine Container VM.

Commands:

  • curl -s -o - https://raw.githubusercontent.com/newsnowlabs/runcvm/main/runcvm-scripts/runcvm-install-runtime.sh | sudo sh

  • docker run --runtime=runcvm --rm -it --cpus=4 -m 1g alpine

Markers

00.0 - Install RunCVM
37.0 - Launch an Alpine container-VM

Notes

This demo was itself recorded within a clean RunCVM container-VM, built and launched as following.

Build:

cat <<EOF | docker build --tag=ubuntu-docker -
FROM ubuntu:jammy
RUN apt update && apt -y install apt-utils kmod wget iproute2 systemd ca-certificates curl gnupg udev dbus sudo psmisc asciinema && curl -fsSL https://get.docker.com | bash
RUN echo kvm_intel >>/etc/modules
RUN useradd --create-home --shell /bin/bash --groups sudo,docker dockside && echo dockside:dockside | chpasswd && echo export PS1='\$ ' PROMPT_COMMAND='' >>/home/dockside/.bashrc
RUN echo 'dockside ALL=(ALL) NOPASSWD: ALL' >/etc/sudoers.d/dockside
ENTRYPOINT ["/lib/systemd/systemd"]
EOF

Run:

docker run -d --runtime=runcvm -m 2g --name=ubuntu-docker --env=RUNCVM_DISKS='/disks/docker,/var/lib/docker,ext4,2G;/disks/opt,/opt,ext4,2G' -v /asciinema:/asciinema ubuntu-docker; docker exec -it -u dockside ubuntu-docker bash; docker rm -f ubuntu-docker