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.

  • Deploy changes to Docker container using Jenkins
  • Docker compose, running containers in net:host
  • How to properly launch an OpenShift v3 app
  • Shared, ephemeral read-only Docker volume
  • Kubernetes pod running out of memory when writing to a volume mount
  • Running VirtualBox in Ubuntu in Mac OSX, won't start up
  • Docker in docker on AWS Elastic Beanstalk
  • Docker instance cannot run images anymore and unable to reclaim free space
  • Docker install memcached
  • Understanding Mounted Directories with Fig and Docker
  • Private environment variables when deploying with Docker on AWS Elastic Beanstalk
  • Cgroups report weird cpu and memory usage
  • 2 Solutions collect form web for “How to download file from docker container?”

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

    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

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.