Skip to content
Docker container for building an iso image for a python script with some dependencies, so that it can be deployed as a python3 rumprun unikernel
Shell Dockerfile Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


This is a Docker image that helps you build an image for running an arbitrary python snippet as a rumprun unikernel on top of Solo5.

How to

Our goal is to build the python script inside an image that we can later deploy as a unikernel on top of Solo5 or using a Nabla container.

The Docker image expects to find the script file under the /build directory of the container. So we need to bind a host directory to the /build directory of the container.

Finally, we need to let the container know the names of the script file and the output iso image that we want the container to build, so we pass them as argument when invoking docker run

Assuming we have on the current directory the python file that we want to build we run:

docker run --rm -v $(pwd):/build cloudkernels/python3-build hello.iso 

This will create two files in our current directory. The hello.iso file which is the image that contains our python installation and python.spt and python.hvt which are the Python3 rumprun kernels for the spt and hvt Solo5 targets respectively.

Handling python dependencies

If our python script imports python packages we need to let the build system know about these. Our Docker image handles these dependencies through an extra requirements file we pass at run time as an extra argument.

The requirements file includes the dependencies of our python script in the form of one dependency per line.

For example image we want to run a simple script that uses the requests python package and looks like this:

import requests

r = requests.get('')

In order to build the image for this script we need to provide the requirements.txt file which includes a single line looking like this:

bchalios@localhost:~$ cat requirements.txt

Like before, we invoke our container:

docker run --rm -v $(pwd):/build cloudkernels/python3-build requests.iso requirements.txt
You can’t perform that action at this time.