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

How to enter the docker container

尚
Original
2020-03-30 09:48:5911378browse

How to enter the docker container

Several ways to enter the docker container:

1. Use the docker attach command to enter

docker attach 44fc0f0582d9

However, this method has shortcomings. When multiple When windows enter the container using this command at the same time, all windows will be displayed simultaneously. If one window is blocked, other windows will no longer be able to operate.

2. Use the docker exec command to enter

docker exec -it 44fc0f0582d9 /bin/bash

Note: If the following error occurs:

OCI runtime exec failed: exec failed: container_linux.go:345: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown

is that the /bin/bash file in our docker image does not exist. What may exist is the /bin/sh file, just use the following command:

docker exec -it 44fc0f0582d9 /bin/sh

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