How to Copy Files From Docker Ubuntu Container to Windows Host

I can’t figure out how to copy files from a docker ubuntu container to a windows host, or vice versa.

My host is Windows 10. When I start Docker, I run the Ubuntu image using

  • Docker composer, constraint - did not find expected key
  • Allow redeploy for “latest” docker tag in Nexus OSS
  • Docker container vs Java Virtual Machine
  • Use apt-get fails on docker python:2.7.12-wheezy image
  • Find the docker containers using an image?
  • Docker try to download unnecessary busybox image on creation of redis pod with kubernetes tools
  • docker run -it ubuntu bash
    

    The documentation I’ve read says that the way the transfer files is with docker cp, but apparently that command doesn’t exist in this ubuntu image, i.e., bash: docker: command not found.

    This must be a dumb oversight on my part. Can someone please give me a little help?

  • Can't create Docker network
  • docker - does it bypass instance-checking limitation like virtual machine
  • memory usage reporting by kernel in log when task is killed due to OOM
  • How to re-mount a docker volume without overriding existing files?
  • Allowing 'anyone' executable permission on /usr/local/bin/docker-compose?
  • How to pass command line arguments to a docker image
  • One Solution collect form web for “How to Copy Files From Docker Ubuntu Container to Windows Host”

    You need to run docker cp command on host machine.

    The command template is:

    docker cp <containerId>:<src_path_inside_container> <target_host_path>
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.