1
votes

I'd like to dynamically grant a given Docker container (or Docker image, doesn't matter) access to a specific azure storage account blob container.

Neither the blob container nor the azure container is going to be the same every time, i.e.

  • Grant DockerContainer1 access to AzureContainerX
  • Grant DockerContainer2 access to AzureContainerY
  • ...

Is this even possible? Can I use Volume in dockerfile? Can I do this from my .net core web API app?

If so, how?

1

1 Answers

0
votes

I believe you need to set up shared named volume on host, which is then filled with data from the AzureContainerX on runtime. Then all you need to do, is to share this volume into DockerContainer2 and access data from there.

Volumes are not used in the Dockerfile, instead they are set when starting the container with CMD parameters or by using compose file.

Refer for Docker documentation how to use volumes. You can set volumes are read-only.

However, I don't know how exactly you would like to set this up dynamically. You need configuration for each AzureContainerY container, that they are putting data into correct place. Also DockerContainer1 should be configured to access for data in correct paths. This might be achieved dynamically by setting up ENV values by using ARGs, but this really depends on the context here, and gets quickly very complicated.