1

问题

我正在构建一个包含整个Oracle Commerce Guided Search平台的映像,因为可以成功地构建映像,但由于引发以下异常,包含的 Java 进程将无法运行:

Exception in thread "main" java.lang.RuntimeException: java.net.UnknownHostException:37863d1a232e: System error
    at com.endeca.itl.service.ServiceLocator.getService(ServiceLocator.java:226)
    at com.endeca.itl.component.manager.cmd.task.ComponentManagerTask.getManager(ComponentManagerTask.java:69)
    at com.endeca.itl.component.manager.cmd.task.DeleteComponentInstanceTask.process(DeleteComponentInstanceTask.java:71)
    at com.endeca.itl.cmd.BaseCmd.run(BaseCmd.java:464)
    at com.endeca.itl.component.manager.cmd.ComponentManagerCmd.main(ComponentManagerCmd.java:99)
Caused by: java.net.UnknownHostException: 37863d1a232e: System error
    at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
    at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
    at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
    at java.net.InetAddress.getAllByName0(InetAddress.java:1276)
    at java.net.InetAddress.getAllByName(InetAddress.java:1192)
    at java.net.InetAddress.getAllByName(InetAddress.java:1126)
    at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:44)
    at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:102)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:314)
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:219)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:85)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:186)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:106)
    at com.endeca.itl.util.UrlUtils.ping(UrlUtils.java:180)
    at com.endeca.itl.util.UrlUtils.ping(UrlUtils.java:149)
    at com.endeca.itl.service.ServiceLocator.getService(ServiceLocator.java:217)
    ... 4 more

通过查看异常,是否清楚主机名被设置为:37863d1a232e

Exception in thread "main" java.lang.RuntimeException: java.net.UnknownHostException: 37863d1a232e: System error

如果我检查 OS $HOSTNAME,我会得到以下输出:

[root@37de552fbd05 bin]# echo $HOSTNAME
37de552fbd05

这与 /etc/hosts/ 中显示的输出相同:

[root@37de552fbd05 bin]# cat /etc/hosts/
127.0.0.1       localhost
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.17.0.2      37de552fbd05

但是,它不是在例外中显示的那个。

我试图解决这个问题的方法是什么?

  1. 我已将 --hostname 标志用作 --hostname=localhost
  2. 我试图解决这个帖子:32537977

事实

  1. 我使用 Mac OS(High Sierra,10.13.5)作为主机。
  2. Docker 社区版(Engine:18.03.1-ce)用于构建 Docker Image。
  3. 虚拟操作系统是oraclelinux:7.2
  4. 不幸的是,我没有成功执行上述解决方法。

不幸的是,我没有成功。

问题

发生这种情况的原因可能是什么?

来源

  1. Dockerfile
4

0 回答 0