To copy a folder from a running Docker container to your local machine, use the docker cp
command. Here's how to do it:
First, find the container ID or name of the running container by listing all running containers:
docker ps
This command will show you the container ID, image name, created time, status, ports, and container name.
Use the docker cp
command to copy the folder (e.g., "models") from the container to your local machine:
docker cp CONTAINER_ID:/path/to/models /local/path/for/models
Replace CONTAINER_ID
with the actual container ID or name from the docker ps
output. Replace /path/to/models
with the path to the "models" folder inside the container, and /local/path/for/models
with the destination path on your local machine.
For example, if the "models" folder is located at /app/models
inside the container and you want to copy it to your local machine's /home/user/models
directory, the command would be:
docker cp CONTAINER_ID:/app/models /home/user/models
This command will copy the "models" folder and its contents from the container to your local machine.