1

Is there any way to use loop devices within docker container without switching on a privileged mode. It looks like there should be a way with adding capabilities, but even when I run container with flag --cap-add=ALL I still get an error when I execute losetup -f command:

[root@176f9063d3bb /]# losetup -f losetup: Could not find any loop device. Maybe this kernel does not know about the loop device? (If so, recompile or 'modprobe loop'.)

Aram Antonyan
  • 149
  • 1
  • 7

1 Answers1

0

you can use add cap and enabled the specific device to use this :

docker run -td --cap-add SYS_ADMIN  --device /dev/loop0 --device /dev/loop-control
miki hayut
  • 106
  • 1