Moving files (Dockers, Servers, Localhost,…)

From Server to Host

From terminal:

scp [server_user]@[server_ip]:/file/path/within/server .

This will copy the file /file/path/within/container to our current directory

From Host to Server

From terminal:

scp /local/file/path/ [server_user]@[server_ip]:/file/path/within/server

This will copy the file /local/file/path/ to /file/path/within/server path

From Docker to Host

From terminal:

sudo docker cp [containerid]:/file/path/within/container .

[containerId] can be found by typing «docker ps» from terminal

This will copy the file /file/path/within/container to our current directory

From Host to Docker

From terminal:

sudo docker cp /local/file/path/ [docker_container_name]:/file/name/on/docker/

This will copy the file /local/file/path/ to the root folder into the container [docker_container_name] with the name specied at /file/name/on/docker/