Version: 1.0.0

Building Netkit-JH with Docker

The current Netkit-JH build scripts currently rely on being run on a Debian Bullseye host. An alternative to creating a full VM for Netkit development is using a docker container based on a Debian Bullseye image.

Install Docker#

Install docker using the instructions here.

Clone the Netkit Build Repo#

$ git clone https://github.com/netkit-jh/netkit-jh-build.git
$ cd netkit-jh-build

The following commands assume that your working directory is the root of this repo.

Building the Docker Image#

First we need to build a docker image which will be used for building Netkit-JH.

$ docker build -t netkit-builder-deb .

This creates an image under the name 'netkit-builder-deb'.

Running the Build Process in the Docker Image#

To compile all components of Netkit-JH (the kernel, the filesystem and the core executables) run:

$ docker run --privileged -v $(pwd):/netkit-build -it netkit-builder-deb

If you would like to pass your own arguments to make, you can add -e MAKE_ARGS="" to the docker command, with the necessary make arguments. Some examples are shown below:

$ docker run --privileged -v $(pwd):/netkit-build -e MAKE_ARGS="build-kernel" -it netkit-builder-deb
caution

The kernel must be built before the filesystem! This is because the kernel modules are copied over to the filesystem as part of the fs build process. If you don't give any MAKE_ARGS this won't be an issue, but if you decide to give MAKE_ARGS="build-fs" before the kernel has been built, it will not build successfully.