I have a container that generates an mp4 file for me, which I want to download / copy to my host system after the container script has been completed.
What I managed to do is add a sleep 2m to the end of my entrypoint.sh before calling exit 0 (it's a bit hacky, I know 😅) which gives me 2 minutes to run the following command to download the mp4 file.
docker cp gource_container:/output/generated.mp4 ./
This works fine when i do it by hand, but my goal is to run it automatically via bash script.
Is there any way to cp the file to my host system after the container exits?
When I run the cp command after the container is done without sleep i get the following error:
$ docker cp gource_container:/output/generated.mp4 ./
Error: No such container:path: gource_container:/output/generated.mp4