Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

2.6K
Views
Docker: Temporary failure resolving 'deb.debian.org'

I have a Rails application that I want to deploy using Docker on an Ubuntu server. I have the Dockerfile for the application already set up, right now I want to view the nginx conf in its container.

I ran the command below to start an nginx container in an interactive mode:

docker run -i -t nginx:latest /bin/bash

Right now I am trying to install nano editor in order to view the configuration for nginx configuration (nginx.conf) using the commands below:

apt-get update
apt-get install nano
export TERM=xterm

However, when I run the first command apt-get update, I get the error below:

Err:1 http://security.debian.org/debian-security buster/updates InRelease
  Temporary failure resolving 'security.debian.org'
Err:2 http://deb.debian.org/debian buster InRelease                  
  Temporary failure resolving 'deb.debian.org'
Err:3 http://deb.debian.org/debian buster-updates InRelease
  Temporary failure resolving 'deb.debian.org'
Reading package lists... Done    
W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease  Temporary failure resolving 'deb.debian.org'
W: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease  Temporary failure resolving 'security.debian.org'
W: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/InRelease  Temporary failure resolving 'deb.debian.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.

I have checked very well it has nothing to do with network connectivity. I would need some help. Thank you.

over 4 years ago · Santiago Trujillo
11 answers
Answer question

0

I had a similar issue, I tried many suggested solutions, but my issue was gone after I rebooted my VM.

over 4 years ago · Santiago Trujillo Report

0

Here's how I solved it:

Start the docker container for the application in an interactive mode, in my case it an nginx container :

docker run -i -t nginx:latest /bin/bash

Run the command below to grant read permission to the others role for the resolv.conf file:

chmod o+r /etc/resolv.conf

Note: If you are having this issue on your host machine (Ubuntu Linux OS) and not for the Docker containers, then run the same command adding sudo to it in the host machine terminal:

sudo chmod o+r /etc/resolv.conf

Endeavour to exit your bash interactive terminal once you run this:

exit

And then open a new bash interactive terminal and run the commands again:

apt-get update
apt-get install nano
export TERM=xterm

Everything should work fine now.

Reference to this on Digital Ocean: Apt error: Temporary failure resolving 'deb.debian.org'

That's all.

over 4 years ago · Santiago Trujillo Report

0

I easily resolved it via:

- docker exec -it nginx bash (Go inside container)
- ping google.com (if not working)
- exit (Exit from container)
- sudo service docker restart

Please also confirms /etc/sysctl.conf

- net.ipv4.ip_forward = 1

sudo sysctl -p /etc/sysctl.conf

over 4 years ago · Santiago Trujillo Report

0

If you have VPN running, stop it and try again. It solved for me!

over 4 years ago · Santiago Trujillo Report

0

I simply restarted docker and this worked for me.

sudo service docker restart or sudo /etc/init.d/docker restart

Prior to bumping into this issue, docker was working fine. If you never had docker working in the first place, you probably have a different issue.

over 4 years ago · Santiago Trujillo Report

0

Under Debian, as root, I've ran:

/etc/init.d/docker restart

This solved the issue for me.

Then build and run the container again.

over 4 years ago · Santiago Trujillo Report

0

Perhaps the network on the VM is not communicating with the default network created by docker during the build (bridge), so try "host" network :

docker build --network host -t [image_name]
over 4 years ago · Santiago Trujillo Report

0

I had the same problem and in my case it was file access control.

I uses extended acls on the docker root folder and did not realize it, because they where inherited from the folder above (stupid idea to test docker in a "scratch" directory where permissions are set via extended acls).

This lead to the situation that "/etc/resolv.conf" had setting "640" inside the running docker container with a "+" marking the extended acls. But the image did not have extended acls installed and could not handle it.

The weird thing was that, as far as I can see, all other network tools worked (e.g. ping) but only apt could no access the DNS resolver.

After removing the extended acls from the docker root and setting the usual acls, everything worked inside the running container.

Similar to the answer of "Promise Prestion", but solved permanently for new containers, too.

over 4 years ago · Santiago Trujillo Report

0

Coming here from some docker cross compiling headache:

While forking some repo I manually downloaded its root folder containing confd stuff and added it just like the original maintainer did.

ADD root /

after this I was not able to apt update anymore.

I found that the permission of my root named folder was wrong. stat -f "%OLp" root revealed it is 700, but must be 755 to work.

over 4 years ago · Santiago Trujillo Report

0

Specifying a DNS server for docker containers helped me.

Create a /etc/docker/daemon.json file with this content:

{
  "dns": ["8.8.8.8", "8.8.4.4"]
}

and restart the docker service:

sudo service docker restart

src: https://docs.docker.com/engine/install/linux-postinstall/#specify-dns-servers-for-docker

over 4 years ago · Santiago Trujillo Report

0

Similar issue, under debian. Root cause was a bad DOCKER-USER rule in iptables chain

Those rules have been haded

iptables -I DOCKER-USER -i eno1 -j DROP
iptables -I DOCKER-USER -s 90.62.xxx.xx/32 -i eno1 -j ACCEPT

so removing temporarily following rule fix the point

iptables -D DOCKER-USER -i eno1 -j DROP
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!