lucene Ping或SSH连接到Docker容器时出现问题

zi8p0yeb  于 2022-11-07  发布在  Lucene
关注(0)|答案(1)|浏览(165)

我是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>
yrdbyhpb

yrdbyhpb1#

coady/pylucene映像基于python:latest

  • python:latestbuildpack-deps:buster为基础
  • buildpack-deps:busterbuildpack-deps:scm为基础
  • buildpack-deps:scm基于buildpack-deps:buster-curl
  • buildpack-deps:buster-curldebian:buster为基础
  • debian:buster基于Debian 10

而且... debian 10默认没有openssh-server installed/active
另外,正如这里所提到的:
Docker Desktop for Windows无法将流量路由到Linux容器。
但是,您可以ping Windows容器。
换句话说,你正在经历的那些“问题”完全是意料之中的。

相关问题