Rumprun Nginx Unikernel

From JMK Wiki
Jump to: navigation, search

Prerequisites:

  • genisoimage
emerge -av cdrkit
emerge -av libisoburn

Download and build rumprun:

mkdir -p /usr/local/src/rump
cd /usr/local/src/rump
git clone --recursive https://github.com/rumpkernel/rumprun.git
cd rumprun
./build-rr.sh -qq xen -- -F ACLFLAGS="-march=native -O2 -pipe -fomit-frame-pointer -mno-tls-direct-seg-refs"

Optionally build and run tests (ctor_test fails to build for me, but I don't really care)

./tests/buildtests.sh xen
./tests/runtests.sh xen

Add app-tools to the path

PATH=$PATH:/usr/local/src/rump/rumprun/app-tools

Download and build rump-nginx

cd /usr/local/src/rump
git clone --recursive https://github.com/mato/rump-nginx.git
cd rump-nginx
RUMPRUN_CC=rumprun-xen-cc make

Baking the unikernel

rumpbake -T xen_pv -o bin/nginx.baked bin/nginx

Running the unikernel

rumprun xen -M 128 -di -n inet,static,192.168.0.123/24,192.168.0.1 -b images/stubetc.iso,/etc -b images/data.iso,/data -- bin/nginx.baked -c /data/conf/nginx.conf

Creating ISO

rumprun iso -W xen0,inet,static,192.168.0.123/24,192.168.0.1 -b images/stubetc.iso,/etc -- bin/nginx.baked -c /data/conf/nginx.conf