1. Copy files from the container to the host?

A: Execute the following commands on the host

Docker cp container name (or container id): The path of the file to be copied inside the container is copied to the corresponding path of the host

Example: If the container ID is c06d387397ba and the path to copy from the container is/TMP /workdir/nx1.mp4, copy nx1.mp4 from the container to the /Users/yangx/Downloads path.

docker cp c06d387397ba:/tmp/workdir/nx1.mp4 /Users/yangx/Downloads/nx111.mp4

2. Copy files from the host to the container

A: Execute the following command on the host

Container name (or container id) of the file path to be copied from docker cp: The path to be copied into the container

Example: suppose the container id for c06d387397ba, now will be hosting/Users/yangx/Downloads/nx111. Mp4 files copied to the inside of the container c06d387397ba: / TMP/workdir path below, so command what to write?

docker cp /Users/yangx/Downloads/nx111.mp4 c06d387397ba:/tmp/workdir