1, from the container inside copy files to host.
Answer: Execute the following command in the host
Docker CP container name: The path of the file to be copied inside the container to be copied to the appropriate path of the host
Example: Assuming that the container is named Testtomcat, the file to be copied from the container is:/usr/local/tomcat/webapps/test/js/test.js, now to move test.js from the container Copy to the host's/opt path, so the command should be how to write it.
Answer: Execute command on host
Docker CP testtomcat:/usr/local/tomcat/webapps/test/js/test.js/opt
2. Copy files from host to container inside
Answer: Execute the following command in the host
docker cp to copy file path container name: the corresponding path to be copied to the container
Example: Assuming the container is named Testtomcat, now copy the host/opt/test.js file into the container /usr/local/tomcat/webapps/test/js path, then how to write the command.
Answer: Execute the following command on the host
Docker cp/opt/test.js Testtomcat:/usr/local/tomcat/webapps/test/js
3, here in the record of a problem, how to look at the container name.
Execute command: Docker PS, appear as shown in the picture, where names is the container name.