0

I am trying to build a docker image incorporating this github repo: https://github.com/javgh/sia-nbdserver

This is an nbd-server that caches files locally and then writes them to the sia distributed storage network. I ran modprobe nbd on the host and am now trying to pass through /dev/nbd0 to the container and use nbd-client inside the container to send data the host writes to the device to the nbd-server using a unix domain socket. I can see /dev/nbd0 inside the container, the nbd-server is up and listening on a socket at /tmp/sia-nbdserver but when I try to run # nbd-client -b 4096 -t 3600 -u /tmp/sia-nbdserver /dev/nbd0 I get Error: Couldn't resolve the nbd netlink family, make sure the nbd module is loaded and your nbd driver supports the netlink interface.

I am running the container with --cap-add SYS-ADMIN and --privileged so permissions shouldn't be an issue.

Any ideas?

jesta
  • 1

2 Answers2

0

Run the container with something like:

docker run -it --rm --privileged --cap-add=ALL -v/dev:/dev -v/lib/modules:/lib/modules:ro image-id

And see if the module gets loaded inside the container properly.

Alex
  • 1,872
  • 2
  • 9
0

Had the same, solved with adding --net=host

docker run -it --rm --privileged --cap-add=ALL --net=host -v/dev:/dev -v/lib/modules:/lib/modules:ro image-id
AdminBee
  • 21,637
  • 21
  • 47
  • 71