Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to download file from docker container?

I'm using this Docker Container https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples/udacity . I've made few changes and would like to backup files from it to my hard drive. I can't find solution to do so.

like image 560
AquaK Avatar asked Mar 03 '17 20:03

AquaK


2 Answers

Syntax to copy files/folders from docker container to local filesystem is

docker cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH|-

Ex : docker cp b8ddea5d8fad:/mnt/mydir/ ./localDir

Syntax to copy files/folders from local filesystem to docker container is

docker cp [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH

Ex : docker cp ./localDir/dirToCopy b8ddea5d8fad:/mnt/newDir/

Docker Documentation here

like image 151
Vivek Avatar answered Nov 15 '22 02:11

Vivek


You could use 'docker cp' command to retrieve particular files. https://docs.docker.com/engine/reference/commandline/cp/

like image 26
Olesya Bolobova Avatar answered Nov 15 '22 04:11

Olesya Bolobova