how to add a config file to docker
Hi,
I am new in generating a docker container. I have a small code that I am trying to dockerize. I need to add some --volume so that the container will have access to the local computer data. However, there are 3,4 different paths that I want to add meaning that there will be 4 --volume in the DOCKER RUN command! Is it possible to add all those paths to a config.json file and ask the RUN command to read it from there?
Below is my code:
docker run --volume /path to data 1:/usr/bin/Data1 \
--volume /path to data 2:/usr/bin/Data2 \
--volume /path to data 3:/usr/bin/Data3 \
--volume /path to data 4:/usr/bin/Data4 \
-e PASSWORD=pass -e USERID=$UID -p 8080:8787 test
I need it to be something like following: if it is possible
docker run --volume config.json -e PASSWORD=pass -e USERID=$UID -p 8080:8787 test
Thanks!
• 1,669 views
•
link
1 answer
You can use : for multiple volumes:
docker run \
--volume /usr/bin/Data1:/usr/bin/Data2:/usr/bin/Data3:/usr/bin/Data4 \
-e PASSWORD=pass -e USERID=$UID -p 8080:8787 test
• 0 views
•
link
Log in to answer this question.
How is this related to bioinformatics?