Home > Operation and Maintenance > Docker > How to put files into docker container

How to put files into docker container

Release: 2020-03-19 14:21:15
Original
19698 people have browsed it

How to put files into docker container

Perfectly copy local files to docker container:

(1) Find the container

docker ps -a
Copy after login

How to put files into docker container

(2) Determine our container name and get the container long ID

docker inspect -f '{{.ID}}' store-dev
Copy after login

How to put files into docker container

(3) Copy local files to the container

docker cp 你的文件路径 容器长ID:docker容器路径
Copy after login

Example:

Assume that the container name is 68b99. Now you need to copy the host/var/backup/nginx.zip file to the /cert path in the container.

Execute the command on the host:

docker cp /var/backup/nginx.zip 68b99:/cert
Copy after login

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 put files into docker container. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template