-
I have a Dockerfile that produces some build artifacts. I’m struggling to find an example or documentation in this case where I need to copy files out of the build Dockerfile. Does someone have an example I could please refer to? Thank you in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
With Docker in general, the following ways to get files out of a container come to mind:
Do you use your Docker image via In the former case, use the In the latter case, you would also need to do that, but by manually mounting a volume with |
Beta Was this translation helpful? Give feedback.
-
There is a better way now |
Beta Was this translation helpful? Give feedback.
With Docker in general, the following ways to get files out of a container come to mind:
Run the
docker cp
commandThis would need to be run on the host system, however.
Mount a folder of the host system into the container as a volume, then copy files to the mounted folder inside the container.
Use a multi-stage Docker image to only leave the files you are interested in in the container at the end of the image building process. If you want to copy out files when running this image later, then this option is irrelevant.
Afterwar…