how to add a config file to docker
1
0
Entering edit mode
2.3 years ago
maria2019 ▴ 250

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!

docker container offtopic • 810 views
ADD COMMENT
0
Entering edit mode

How is this related to bioinformatics?

ADD REPLY
0
Entering edit mode
2.3 years ago
zorbax ▴ 610

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
ADD COMMENT

Login before adding your answer.

Traffic: 2614 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6