Home>Article>Operation and Maintenance> How to access files in docker container

How to access files in docker container

angryTom
angryTom Original
2020-03-16 17:56:08 10953browse

How to access files in docker container

How to access the files in the docker container

1. You can access the files in the docker container Copy the file, then copy it back after processing. The specific operations are as follows:

1. How to download the file from the docker container:

docker cp container_created:path 

Among them: 98953a78f52873edae60a617ec082494 is the local storage path of.

2. How to upload files from the local machine to the docker container

docker cp  container_created:path

Example:

$docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 266f4acef99b reg.docker.alibaba-inc.com/alibase/alios7u2 "/sbin/init" 4 hours ago Up 4 hours $docker cp 266f4:/root/feedback_venv/feedback_venv.zip /Users/Downloads/

2. You can also enter the container and perform operations:

sudo docker exec -it container_created /bin/bash

For more related tutorials, please pay attention to thedocker tutorialcolumn on the PHP Chinese website.

The above is the detailed content of How to access files in 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