LPI
305-300 · Question #87
After setting up a data container using the following command: docker create -v /data --name datastore debian /bin/true How is an additional new container started which shares the /data volume with…
The correct answer is C. docker run --volumes-from datastore --name service debian bash. The correct way to start a new container that shares the /data volume with the datastore container is to use the --volumes-from flag. This flag mounts all the defined volumes from the mounted in the service container at the same path.
Containerization
Question
After setting up a data container using the following command: docker create -v /data --name datastore debian /bin/true How is an additional new container started which shares the /data volume with the datastore container?
Options
- Adocker run --share-with datastore --name service debian bash
- Bdocker run -v datastore:/data --name service debian bash
- Cdocker run --volumes-from datastore --name service debian bash
- Ddocker run -v /data --name service debian bash
- Edocker run --volume-backend datastore -v /data --name service debian bash
How the community answered
(44 responses)- B5% (2)
- C84% (37)
- D2% (1)
- E9% (4)
Explanation
The correct way to start a new container that shares the /data volume with the datastore container is to use the --volumes-from flag. This flag mounts all the defined volumes from the mounted in the service container at the same path.
Topics
#Docker volumes#volumes-from#data container#volume sharing
Community Discussion
No community discussion yet for this question.