How to upload local files to docker container

How to upload local files to docker container

How to upload local files to docker container ? Docker  is an open source application container engine that allows developers to package their applications and dependent packages into a portable container. When uploading files directly to the docker container using rz, the speed is very slow, so we will consider uploading local files to the container.

First we have to enter the docker container

Find all container ids

docker ps -a

Find the container long ID

docker inspect -f '{ {.ID}}' tomcat-container-id

Copy local files to the container

docker cp local path container long ID: container path

1

docker cp /usr/myfile/Test.war 38ef22f922704b32cf2650407e16b146bf61c221e6b8ef679989486d6ad9e856:/usr/local/tomcat/webapps/Test.war

 

 

Guess you like

Origin blog.csdn.net/qq_42533216/article/details/110133509