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?

  • Selenium Grid with Docker containers on different hosts
  • Is second value required when mapping ports in docker-compose file?
  • Connect CI Runner to Docker network
  • Running quick programs inside a docker container
  • Cache gems in GitLab CI bundle build
  • Can I run multiple programs in a Docker container?
  • Unable to get Maven version from /usr/share/maven/bin/mvn Could not find system variable
  • How to use gcloud preview app run without boot2docker? [duplicate]
  • Docker compose linking to mariaDB
  • Angular2 deploy in docker container disturbs routing
  • How to deploy Spring Boot application to Google Managed VM
  • Docker - increase size of the /dev/shm
  • 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.