Mount SMB/CIFS share within a Docker container

后端 未结 5 2025
遥遥无期
遥遥无期 2020-11-29 03:03

I have a web application running in a Docker container. This application needs to access some files on our corporate file server (Windows Server with an Active Directory dom

5条回答
  •  日久生厌
    2020-11-29 03:26

    Yes, Docker is preventing you from mounting a remote volume inside the container as a security measure. If you trust your images and the people who run them, then you can use the --privileged flag with docker run to disable these security measures.

    Further, you can combine --cap-add and --cap-drop to give the container only the capabilities that it actually needs. (See documentation) The SYS_ADMIN capability is the one that grants mount privileges.

提交回复
热议问题