Docker loading kernel modules

后端 未结 3 1657
无人共我
无人共我 2020-12-05 15:32

I tried to install a kernel module, xfsprogs. It was successfully installed inside a container. It is really surprising, but lsmod doesn\'t list th

3条回答
  •  独厮守ぢ
    2020-12-05 16:20

    • Run the container in privileged mode (--privileged)
    • Add all capabilities (--cap-add=ALL)
    • mount host /lib/modules into the container (-v /lib/modules:/lib/modules)
    docker run --name container_name --privileged --cap-add=ALL -d \
           -v /dev:/dev -v /lib/modules:/lib/modules image_id
    

    Caution: Here all Linux capabilities are added so capabilities can be refined.

提交回复
热议问题