Copy the host file to docker

1. View all running containers

docker ps

Insert image description here

2. Find the ID based on the docker Name

命令:docker inspect -f '{
   
   {.ID}}' yourDockerName
结果:a1921259e9550c1ec6b32257d4b01d8888888f317e0bad66a48c245fa1ba7a92

3. Copy files

docker cp /src/src.txt a1921259e9550c1ec6b32257d4b01d8888888f317e0bad66a48c245fa1ba7a92:/tmp/dst.txt

After completion, go to the directory specified in the container to view the file.

Guess you like

Origin blog.csdn.net/qq_33191599/article/details/107376746