There is such a command:

docker run --rm --volumes-from myredis -v $(pwd)/backup:/backup2 debian cp /data/dump.rdb /backup2/ 

myredis - This is a container running in the background.

$(pwd)/backup is my folder on my computer without a docker, right? It will be shared with the /backup2 folder in the myredis container.

And then we execute the command to copy the file to the backup2 folder, but this command will be executed in the new debian container, where will the /data folder and the /backup2/ folder /backup2/ ?

    1 answer 1

    Docker daemon when launching new container

    • will take all the volumes from myredis and mount inside as they were specified when starting myredis
    • will mount the $(pwd)/backup folder inside as /backup2

    So /data will appear only if it is in myredis .