0

Trying to run a decentralized vpn inside of a docker image. The issue im running to I think has to do with my running and installed kernels are different. I have to run modprobe wireguard in my docker file and its returning modprobe: FATAL: Module wireguard not found in directory /lib/modules/5.10.25-linuxkit I know the issue is related to the running kernels but im not sure what the fix would be. Heres my current Dockerfile.

FROM ubuntu:20.04

USER root

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
    git \
    gcc \
    make \
    musl-dev \
    unbound \
    libtool \
    g++ \
    file \
    automake \
    autoconf \
    libssl-dev \
    libexpat-dev \
    bison \
    systemd \
    iproute2 \
    sudo \
    wireguard-tools

RUN systemctl enable systemd-resolved

COPY . /sentinelnode /bin/

COPY . /.sentinelnode /root/

COPY . /hnsd /bin/

RUN chmod +x /bin/sentinelnode

RUN chmod +x /bin/hnsd

RUN sudo modprobe wireguard

RUN cd $HOME

CMD sentinelnode start
Shibalba
  • 1
  • 2
  • Docker containers share the kernel with the host machine. Can you show us how you run your container? Also, have you tried running it with the `--privileged` flag? Btw, you don't need that `USER` line and your `ARG` should probably be an `ENV`. And, I'm not sure that `systemd` works in a container the way you'd expect, so normally we use a `--init` flag on the runner to ensure that process orphans are managed etc. and we use the `ENTRYPOINT` and `CMD` entries to ensure that our processes are running (one main process per container) – Software Engineer Jul 14 '21 at 09:27
  • You pretty much can't load kernel modules from Docker at all (see [Is it possible to use a kernel module built from within Docker?](https://stackoverflow.com/questions/54479529/is-it-possible-to-use-a-kernel-module-built-from-within-docker)). You also can't do it from a Dockerfile, which can't be run as privileged and doesn't persist changes like this. Running this task inside a virtual machine (with a separate kernel and systemd) might work better than Docker. – David Maze Jul 14 '21 at 10:37
  • @Softawre Engineer Im running the container on a decentralized cloud compute platform and we use SDL files to pass arguments. So i cant really do `docker run ` I think unless i create an `ENTRYPOINT` script and load it in the dockerfile? – Shibalba Jul 20 '21 at 10:11

0 Answers0