Skip to content

Commit

Permalink
Add README examples for two system loads
Browse files Browse the repository at this point in the history
  • Loading branch information
struanb committed Jan 8, 2024
1 parent cf4c3a6 commit a729618
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ docker exec -it ubuntu1 bash

Launch a VM with 1G memory and a 1G ext4-formatted backing file mounted at `/var/lib/docker` and stored in the underlying container's filesystem:

```sh
```console
docker run -it --runtime=runcvm --memory=1G --env=RUNCVM_DISKS=/disks/docker,/var/lib/docker,ext4,1G <docker-image>
```

Launch a VM with 2G memory and a 5G ext4-formatted backing file mounted at `/var/lib/docker` and stored in a dedicated Docker volume on the host:

```sh
```console
docker run -it --runtime=runcvm --memory=2G --mount=type=volume,src=runcvm-disks,dst=/disks --env=RUNCVM_DISKS=/disks/docker,/var/lib/docker,ext4,5G <docker-image>
```

Expand All @@ -56,14 +56,35 @@ cd runcvm/tests/00-http-docker-swarm && \
NODES=3 MTU=9000 ./test
```

### System workloads

Launch OpenWRT with port forward to LuCI web UI on port 10080:

```console
docker import --change='ENTRYPOINT ["/sbin/init"]' https://archive.openwrt.org/releases/23.05.2/targets/x86/generic/openwrt-23.05.2-x86-generic-rootfs.tar.gz openwrt-23.05.2 && \
docker network create --subnet 172.128.0.0/24 runcvm-openwrt && \
echo -e "config interface 'loopback'\n\toption device 'lo'\n\toption proto 'static'\n\toption ipaddr '127.0.0.1'\n\toption netmask '255.0.0.0'\n\nconfig device\n\toption name 'br-lan'\n\toption type 'bridge'\n\tlist ports 'eth0'\n\nconfig interface 'lan'\n\toption device 'br-lan'\n\toption proto 'static'\n\toption ipaddr '172.128.0.5'\n\toption netmask '255.255.255.0'\n\toption gateway '172.128.0.1'\n" >/tmp/runcvm-openwrt-network && \
docker run -it --rm --runtime=runcvm --name=openwrt --network=runcvm-openwrt --ip=172.128.0.5 -v /tmp/runcvm-openwrt-network:/etc/config/network -p 10080:80 openwrt-23.05.2
```

Launch Ubuntu with Docker and [Sysbox](https://github.com/nestybox/sysbox) runtime, then within it run an Alpine _Sysbox_ container and, _within that_ install dockerd and run a container from the 'hello-world' image:

```console
echo -e "FROM ubuntu:jammy\nRUN apt update && apt -y install apt-utils kmod wget iproute2 systemd ca-certificates curl gnupg udev dbus && curl -fsSL https://get.docker.com | bash\nRUN wget -O /tmp/sysbox.deb https://downloads.nestybox.com/sysbox/releases/v0.6.2/sysbox-ce_0.6.2-0.linux_amd64.deb && apt -y install /tmp/sysbox.deb\nENTRYPOINT [\"/lib/systemd/systemd\"]" | docker build --tag=ubuntu-docker-sysbox -
docker run -d --runtime=runcvm -m 2g --name=ubuntu-docker-sysbox --env=RUNCVM_DISKS='/disks/docker,/var/lib/docker,ext4,1G;/disks/sysbox,/var/lib/sysbox,ext4,1G' ubuntu-docker-sysbox
docker exec ubuntu-docker-sysbox bash -c "docker run --rm --runtime=sysbox-runc alpine ash -x -c 'apk add docker; dockerd &>/dev/null & sleep 5; docker run --rm hello-world'"
docker rm -f ubuntu-docker-sysbox
```

Launch Ubuntu with Docker and RunCVM runtime installed, then within it run an Alpine _RunCVM_ container-VM, and within that install dockerd and, _within that_, run a container from the 'hello-world' image:

```console
echo -e "FROM ubuntu:jammy\nRUN apt update && apt -y install apt-utils kmod wget iproute2 systemd ca-certificates curl gnupg udev dbus && curl -fsSL https://get.docker.com | bash\nCOPY --from=newsnowlabs/runcvm:latest /opt /opt/\nRUN rm -f /etc/init.d/docker && bash /opt/runcvm/scripts/runcvm-install-runtime.sh --no-dockerd && echo kvm_intel >>/etc/modules\nENTRYPOINT [\"/lib/systemd/systemd\"]" | docker build --tag=ubuntu-docker-runcvm -
docker run -d --runtime=runcvm -m 2g --name=ubuntu-docker-runcvm --env=RUNCVM_DISKS='/disks/docker,/var/lib/docker,ext4,1G' ubuntu-docker-runcvm
docker exec ubuntu-docker-runcvm bash -c "docker run --rm --runtime=runcvm alpine ash -x -c 'apk add docker; dockerd &>/dev/null & sleep 5; docker run --rm hello-world'"
docker rm -f ubuntu-docker-runcvm
```

## RunCVM-in-Portainer walk-through

[![Playing around with RunCVM, a docker runtime plugin](https://i.ytimg.com/vi/OENaWDlCWKg/maxresdefault.jpg)](https://www.youtube.com/watch?v=OENaWDlCWKg "Playing around with RunCVM, a docker runtime plugin")
Expand Down

0 comments on commit a729618

Please sign in to comment.