问题:
I'm getting started working with Docker. 我开始使用Docker了。 I'm using the WordPress base image and docker-compose. 我正在使用WordPress基本图像和docker-compose。
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执行此操作的正确方法是什么?
解决方案:
参考一: https://stackoom.com/question/22bGv/我如何进入Docker容器的shell参考二: https://oldbug.net/q/22bGv/How-do-I-get-into-a-Docker-container-s-shell
来源:oschina
链接:https://my.oschina.net/u/4432649/blog/4318920