How can I copy a file from one folder to another folder within a container in Docker?

I already found ways for moving file between host and container but was not able to figure out on how to moves files within same container using YML. Can some one help me on this?

  • Kubernetes MySQL replication - Master service host inquiry
  • docker-compose environment variables used as path for volumes don't get resolved
  • Can't start mongo with docker command, but can with /bin/bash inside container (with data volume)
  • Reliability of Docker containers
  • remote control nginx configuration
  • docker service replicas remain 0/1
  • Docker daemon no start
  • How to run Python server on Docker's container
  • Xdebug inside docker in PhpStorm doesn't work
  • How to configure Jenkins in Docker?
  • Converting a mounted volume to a Docker Image
  • Kubernetes keeps removing Heapster & Grafana services due to already-used NodePort
  • One Solution collect form web for “How can I copy a file from one folder to another folder within a container in Docker?”

    You can use ssh command. First find IP of each docker container and then ssh into one terminal to transfer file.

    man scp
    The very basic usage:
    
    scp remote_user@remote_host:/path/to/remote/file /path/to/local/file
    and vice versa:
    
    scp /path/to/local/file remote_user@remote_host:/path/to/remote/file
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.