我是Docker的新手。我在Windows 10上安装了Docker。而且,我在Win上安装了SSH。
我有一个pylucene码头集装箱。当我检查我的码头集装箱的状态,它是向上的。
PS C:\Windows\system32> docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d70d6f0ed7ab coady/pylucene "/bin/bash" 4 weeks ago Up 3 hours amazing_dubinsky
而且,我在执行它和使用它的shell方面没有问题。
PS C:\Windows\system32> docker exec -it d70d6f0ed7ab /bin/bash
root@d70d6f0ed7ab:/usr/src# python
Python 3.9.2 (default, Mar 31 2021, 12:13:11)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import lucene
>>> print(lucene.VERSION)
8.8.1
>>>
但是当我找到它的IP并尝试从我的win ping这个Docker容器时,结果只是超时!
PS C:\Windows\system32> docker inspect -f "{{ .NetworkSettings.IPAddress }}" d70d6f0ed7ab
172.17.0.3
PS C:\Windows\system32> ping 172.17.0.3
Pinging 172.17.0.3 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 172.17.0.3:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
PS C:\Windows\system32>
与此容器的SSH连接也失败,
PS C:\Windows\system32> ssh root@172.17.0.3
ssh: connect to host 172.17.0.3 port 22: Connection timed out
PS C:\Windows\system32>
1条答案
按热度按时间yrdbyhpb1#
coady/pylucene
映像基于python:latest
python:latest
以buildpack-deps:buster
为基础buildpack-deps:buster
以buildpack-deps:scm
为基础buildpack-deps:scm
基于buildpack-deps:buster-curl
buildpack-deps:buster-curl
以debian:buster
为基础debian:buster
基于Debian 10而且... debian 10默认没有
openssh-server
installed/active。另外,正如这里所提到的:
Docker Desktop for Windows无法将流量路由到Linux容器。
但是,您可以ping Windows容器。
换句话说,你正在经历的那些“问题”完全是意料之中的。