Home > Article > Operation and Maintenance > How to access files in docker container
How to access the files in the docker container
1. You can access the files in the docker container Copy the file, then copy it back after processing. The specific operations are as follows:
1. How to download the file from the docker container:
docker cp container_created:path <path>
Among them: 98953a78f52873edae60a617ec082494 is the local storage path of.
2. How to upload files from the local machine to the docker container
docker cp <path> container_created:path
Example:
$docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 266f4acef99b reg.docker.alibaba-inc.com/alibase/alios7u2 "/sbin/init" 4 hours ago Up 4 hours $docker cp 266f4:/root/feedback_venv/feedback_venv.zip /Users/Downloads/
2. You can also enter the container and perform operations:
sudo docker exec -it container_created /bin/bash
For more related tutorials, please pay attention to the docker tutorial column on the PHP Chinese website.
The above is the detailed content of How to access files in docker container. For more information, please follow other related articles on the PHP Chinese website!