拨打tcp:查找xxx.xxx.xxx.xxx:没有这样的主机

pav*_*van 10 networking automation docker

尝试将Docker映像推送到私有Docker存储库。但出现如下错误: "dial tcp: lookup xxx.xxx.xxx.xxx: no such host"。我已正确登录到存储库并成功构建。

以下命令用于将图像推送到私有 repo: sud docker push x.x.x.x:446/dns/graphs

pav*_*van 10

/etc/resolv.conf文件中编辑DNS名称服务器对我有帮助。

将您现有的名称服务器更改为Google名称服务器,即将xxxx更改为8.8.8.8

评论您的名称服务器IP并添加如下内容:

#nameserver x.x.x.x
nameserver 8.8.8.8  
Run Code Online (Sandbox Code Playgroud)

应该管用。


FTM*_*FTM 6

If you are behind a proxy, this could be your issue. In this case, you need to configure the Docker daemon (not the client) proxy settings. You can do that by:

  1. Create a systemd drop-in directory for the docker service:
    • sudo mkdir -p /etc/systemd/system/docker.service.d
  2. Create a file called /etc/systemd/system/docker.service.d/http-proxy.conf that adds the HTTP_PROXY environment variable:
    • [Service] Environment="HTTP_PROXY=http://proxy.example.com:80/"
  3. Flush changes
    • sudo systemctl daemon-reload
  4. Restart docker daemon
    • sudo systemctl restart docker

参考:Docker 文档