Projects STRLCPY ebpfguard Files
🤬
cb26ce12
ROOT /
docs /
gh /
docker_devel_env.md
39 lines | ISO-8859-1 | 1 KB

Docker based development environment

Reference docker containers with all dependencies needed to develop ebpfguard.

This instruction assumes that docker is installed. For convenience you can add your user to docker group. The following script checks whether current user is in docker group.

$ groups | grep docker 1>/dev/null 2>&1 || echo "$USER is not in docker group. docker command will require sudo"

Ubuntu

To build ubuntu based development docker image run the following docker build command.

$ pwd
<path to ebpfguard repo>/docker
$ cd ubuntu
$ docker build . -t ebpfguard-dev:local

After building you can start a container with this repository mounted into it and run compilation steps. Proposed docker run invocation doesn't copy repository contents. Changes made within container will be present on host machine.

# privileged flag is needed to run ebpfguard applications from within container
$ docker run -it --privileged -v <path to this repository on local filesystem>:/app ebpfguard-dev:local bash
# Previous command drops user into bash shell within container
$ cd app
$ cargo xtask build-ebpf && cargo build && cargo test

Lets assume that ebpfguard repository was cloned to /home/user/ebpfguard.

Docker run command would be:

$ docker run -it --privileged -v /home/user/ebpfguard:/app ebpfguard-dev:local bash
Please wait...
Page is in error, reload to recover