2017-04-11 46 views
0

我在我的機器上運行Ubuntu的碼頭工人,但是當我鍵入apt-get update命令,它說:碼頭工人Ubuntu的16 Ubuntu的14臺機器上:沒有互聯網連接

[email protected]:/# apt-get update 
Err:1 http://archive.ubuntu.com/ubuntu xenial InRelease 
    Temporary failure resolving 'archive.ubuntu.com' 
Err:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease 
    Temporary failure resolving 'archive.ubuntu.com' 
Err:3 http://archive.ubuntu.com/ubuntu xenial-security InRelease 
    Temporary failure resolving 'archive.ubuntu.com' 
Reading package lists... Done   
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease Temporary failure resolving 'archive.ubuntu.com' 
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease Temporary failure resolving 'archive.ubuntu.com' 
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-security/InRelease Temporary failure resolving 'archive.ubuntu.com' 
W: Some index files failed to download. They have been ignored, or old ones used instead. 

我試了「解決方案」,我發現,但仍然不起作用。 我無法訪問泊塢窗中的任何命令,因爲我無法更新。我想因爲我的Docker無法訪問Internet。我怎樣才能解決這個問題 ?

+0

是連接到互聯網+你的主機ubuntu的14是它能夠解析主機名(DNS) – lvthillo

+0

最大的可能是你的路線是錯誤的。運行'sudo route -n'併發布輸出。你也可以運行'ping 8.8.8.8'來確保它不是DNS問題。 –

+0

我在公司網絡上,它似乎是一個DNS解決問題。 @Willian Paixao,我無法在docker中運行任何命令,它顯示「找不到命令」。 –

回答

1

SOLUTION:

我在企業網絡中很,所以我不得不改變DNS IP不會忽略的請按照下列步驟操作:

在主機上:

  • nm-tool | grep DNS這將輸出DNS服務器
  • sudo nano /etc/default/docker並將您在第一步中獲得的DNS更改爲以下行:
    • DOCKER_OPTS="--dns 'your_dns_server_1' --dns 'your_dns_server_2'"
  • 重啓泊塢窗:sudo service docker restart
相關問題