Reputation: 1620
I am using a MySQL Docker container where I want to use a Azure File Share. To create an MySQL Docker container I use the following Buildscript.
FROM mysql:5.7
RUN apt-get update && apt-get upgrade && apt-get install sudo
RUN sudo apt install cifs-utils -y
RUN sudo apt-get install curl -y
RUN cd home
RUN mkdir install
RUN cd install
RUN curl curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
When I enter this container, I use the following command selected from the Azure Portal and create a bash script.
When I execute the script, I get this error:
Unable to apply new capability set.
Can you please help me to mount the Azure File Share to Linux !
Many thanks,
Erik
Upvotes: 4
Views: 7076
Reputation: 1587
To be able to mount Azure File shares you need to add "capabilities" to your container. See https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities
In this case, if you run docker run --cap-add=SYS_ADMIN --cap-add=DAC_READ_SEARCH my_image
(add those two --cap-add
options) then your container will be able to mount the shares.
Upvotes: 7