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