I wish to create a volume and mount it to a docker container in order to collect some artifacts, and I want to reuse these artifacts into another docker container later on. Can i just mount the same volume to the new container and upload the artifacts? Is there an upload command for this?
1 Answer
You can mount a volume e.g. at /app/artifacts
then set up your application to place the artifacts on that folder.
docker run -d \
-v artifacts-vol:/app/artifacts \
artifact-creator:latest
then after that, you can mount the same volume to a separate container and specify on the new container to read the artifacts from the volume location
docker run -d \
-v artifacts-vol:/app/artifacts \
artifact-reader:latest