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

How to put files into docker container

尚
Original
2020-03-19 14:21:15 19428browse

How to put files into docker container

Perfectly copy local files to docker container:

(1) Find the container

docker ps -a

How to put files into docker container

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

docker inspect -f '{{.ID}}' store-dev

How to put files into docker container

(3) Copy local files to the container

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

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

For more related tutorials, please pay attention to thedocker tutorialcolumn 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!

Statement:
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