In my mac, I just want to inspect into the shell of a mongo container created based on the mongo:3.5.8 from docker hub and play with it.
However, Although I can go into the mongo shell by running sudo docker exec -t mongo-test mongo
, the terminal gets stuck and there is no response, after typing any command (such as show dbs
) and hitting enter.
thanks. Any idea could be really helpful.
The screenshot: the terminal get stuck after typing some command environment
Add the interactive option "i" like sudo docker exec -it mongo-test mongo
You can see all the options here: https://docs.docker.com/engine/reference/commandline/exec/
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.