How to enter the docker container

Release: 2020-03-30 09:48:59
Original
11265 people have browsed it

How to enter the docker container

Several ways to enter the docker container:

1. Use the docker attach command to enter

docker attach 44fc0f0582d9
Copy after login

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
Copy after login

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
Copy after login

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
Copy after login

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

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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!