0
votes

For development: I have a node API deployed in a docker container. That docker container runs in a Linux virtual machine. For deployment: I push the docker image to Azure (ARC) and then our admin creates the container (ACI).

I need to copy a data file named "config.json" in a shared volume "data_storage" in Azure.

I don't understand how to write the command in dockerfile that will copy the JSON file in Azure because when I build the dockerfile I am building the image, and that folder should be mapped when creating the container with "docker run -v", so not at the stage of building the image.

Any help please?

2

2 Answers

2
votes

As I know, you can put the copy action and all the actions that depend on the JSON file into a script and execute this script as a command when you run this image so that you do not need the JSON file in the image creation. And when you run the image and the volume mounted, the JSON file already exists in the container and all the actions include the copy action will go ahead.

For the ACI, you can store the JSON file in the Azure File Share and mount it to the ACI, follow the steps that Mount an Azure file share in Azure Container Instances.

0
votes

to copy your file to the shared volume "data_storage" you will need to ask your admin to create the volume mount:

https://docs.microsoft.com/en-us/azure/container-instances/container-instances-volume-azure-files

Assuming you are referring to a data_storage that's an Azure File.