Home >Operation and Maintenance >Docker >How to enter the docker container

How to enter the docker container

藏色散人
藏色散人Original
2020-03-13 13:11:364046browse

How to enter the docker container

How to enter the docker container?

First use the following command to view the container ID (CONTAINER ID):

docker ps -a

Then use the following command to enter container, you can use the bash command to browse the files in the container:

docker exec -it [CONTAINER ID] bash

Some images do not have the bash command, you can use the corresponding Shell, such as sh

docker exec -it [CONTAINER ID] sh

Recommended: "docker tutorial"

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