Docker – Azure Container Instance Mount point permissions

azuredockermountpermissions

I am having some problems with a website that I am running on Azure Container Instances. I've got a wordpress docker image pulling from a private azure container registry, and I'm mounting a file share from an Azure storage account and I'm doing all of this with ARM templates in line with this tutorial.

I've used the example at the bottom of the article. It's all been working fine but suddenly I can't seem to access files on the file share.

I have tried chmod to change permissions: chmod -R 755 myfolder and the command runs but does not update the permissions.

I've also set "readOnly": false on both the volume definition and volumeMount definition in the ARM template.

If I do cat /proc/mounts I can see the cifs mount which is mounted rw but it has dir_mode=0700 and file_mode=0700 which I think is where the problem lies.

I'm not sure if something has changed in azure container instances, or perhaps the docker build pipeline (incidentally, I had changed to the new Ubuntu build agent in VSTS but I tested the legacy linux preview agent but same result)

Any ideas on how I can change the dir_mode and file_mode settings? Are there parameters in the ARM template to change these? I couldn't see any references in the ARM template reference on the microsoft site.

Thanks in advance

Rob

Best Answer

There is a readOnly parameter that you can set to false and see if that makes a difference but 700 is not even readonly.

https://docs.microsoft.com/en-us/azure/templates/Microsoft.ContainerInstance/2018-09-01/containergroups

"azureFile": {
  "shareName": "string",
  "readOnly": boolean,
  "storageAccountName": "string",
  "storageAccountKey": "string"
},

It looks like there is an open issue in GitHub for this issue.

https://github.com/MicrosoftDocs/azure-docs/issues/19017

I recommend you open your own or weigh in on existing issue.

Hope this helps

Related Topic