0

Trying to build a docker image with v4l2loopback installed but am not able to modprobe it after installing it.

getting this error after trying to build using buildx

FATAL: Module v4l2loopback not found in directory /lib/modules/5.4.0-1038-aws

FROM arm64v8/ubuntu:bionic
RUN apt install -y v4l2loopback-dkms
RUN apt install -y v4l2loopback-utils
RUN modprobe v4l2loopback 

I also tried building from source

RUN git clone https://github.com/umlaeute/v4l2loopback.git
WORKDIR /home/v4l2loopback
RUN make && make install
RUN depmod -a
RUN modprobe v4l2loopback

but was unable to build it make[1]: *** /lib/modules/5.4.0-1038-aws/build: No such file or directory.

maxwellpwang
  • 163
  • 1
  • 1
  • 6
  • 6
    A container doesn't have its own kernel, so you'd be loading something on the host kernel. This change wouldn't be persisted in the image (it's not something you'd run in `docker build`), it requires additional privileges a container doesn't normally have, it has global effects outside the container, and it depends on knowing the _exact_ kernel on the host. If you need to isolate this setup from the host, it has to run in a virtual machine with its own kernel. – David Maze Mar 10 '21 at 10:50
  • upstream speaking: @DavidMaze's comment is correct and should be turned into an (accepted) answer. – umläute Mar 18 '21 at 20:39

0 Answers0