简体   繁体   English

AWS上的docker-machine ssh

[英]docker-machine ssh on AWS

From my MAC (running Docker Machine), I have provisioned a host on AWS via docker-machine command. 通过我的MAC(运行Docker Machine),我已经通过docker-machine命令在AWS上配置了主机。 I then connect my terminal to the EC2 based host and I run some docker commands to launch some containers. 然后,将终端连接到基于EC2的主机,然后运行一些docker命令来启动一些容器。 When I do a docker ps command on my MAC, I see the containers which supposingly should be running on the EC2 host. 当我在MAC上执行docker ps命令时,我看到了应该在EC2主机上运行的容器。

To verify that, I wanted to login to the host via docker-machine ssh . 为了验证这一点,我想通过docker-machine ssh登录到主机。 This succeeds, but when running the 'docker ps' account on that EC2 host(to see the container), I get back Cannot connect to the Docker daemon. Is the docker daemon running on this host 这成功了,但是当在该EC2主机上运行“ docker ps”帐户(以查看容器)时,我回来了Cannot connect to the Docker daemon. Is the docker daemon running on this host Cannot connect to the Docker daemon. Is the docker daemon running on this host

How can I get to see a list of containers on the EC2 host? 如何获得EC2主机上的容器列表? How can I know how many containers are running on the EC2 host? 我如何知道EC2主机上正在运行多少个容器?

The SSH user doesn't get added to the docker group automatically. SSH用户不会自动添加到docker组。 See https://github.com/docker/machine/issues/3178 . 参见https://github.com/docker/machine/issues/3178 Thus, you need to add it manually yourself (using usermod -a -G docker docker-user ) or use sudo docker ps . 因此,您需要自己手动添加(使用usermod -a -G docker docker-user )或使用sudo docker ps

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM