[Docker] Temporary failure resolving

Even
1 min readApr 17, 2020

  • docker Run
Step 4/17 : RUN apt-get update && apt-get clean     && apt-get install -y     autoconf     automake     libtool     build-essentialW: Failed to fetch http://deb.debian.org/debian/dists/stretch/InRelease Temporary failure resolving ‘deb.debian.org’
W: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/InRelease Temporary failure resolving ‘security.debian.org’
W: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/InRelease Temporary failure resolving ‘deb.debian.org’
W: Some index files failed to download. They have been ignored, or old ones used instead.

起初我以為是我的server DNS有問題

ping google.com 或 sudo apt-get update都沒有任何問題…

後來發現是docker server DNS需要更正

解法:

  • 修改docker daemon.json
vim /etc/docker/daemon.json
{
"dns": ["8.8.8.8"]
}
  • Restart Docker
sudo service docker restart

此問題就解決了.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response