我如何進入Docker容器的shell? - How do I get into a Docker container's shell?

問題:

I'm getting started working with Docker. 我開始使用Docker了。 I'm using the WordPress base image and docker-compose. 我正在使用WordPress基本圖像和docker-compose。 docker

I'm trying to ssh into one of the containers to inspect the files/directories that were created during the initial build. 我正在嘗試ssh到其中一個容器中來檢查在初始構建期間建立的文件/目錄。 I tried to run docker-compose run containername ls -la , but that didn't do anything. 我試圖運行docker-compose run containername ls -la ,可是沒有作任何事情。 Even if it did, I'd rather have a console where I can traverse the directory structure, rather than run a single command. 即便它確實如此,我寧願有一個控制檯,我能夠遍歷目錄結構,而不是運行單個命令。 What is the right way to do this with Docker? 使用Docker執行此操做的正確方法是什麼? shell


解決方案:

參考一: https://stackoom.com/question/22bGv/我如何進入Docker容器的shell
參考二: https://oldbug.net/q/22bGv/How-do-I-get-into-a-Docker-container-s-shell
相關文章
相關標籤/搜索