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.
asked May 2, 2020 at 22:58
Promise PrestonPromise Preston
21.1k11 gold badges127 silver badges128 bronze badges
1
Try restarting docker. 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.
answered Sep 24, 2020 at 20:14
4
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]
for docker-compose:
service_name:
container_name: name
build:
context: .
network: host
answered Mar 19, 2021 at 20:00
manumazumanumazu
6134 silver badges2 bronze badges
6
If you have VPN running, stop it and try again. It solved for me!
answered Aug 14, 2020 at 15:26
1
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.
Asclepius
54.5k16 gold badges157 silver badges139 bronze badges
answered May 2, 2020 at 22:58
Promise PrestonPromise Preston
21.1k11 gold badges127 silver badges128 bronze badges
1
sudo vi /etc/docker/daemon.json
and check flag of iptables, aslo add DNS if not added
{...., "iptables":true,"dns": ["8.8.8.8", "8.8.4.4"]}
then
sudo service docker restart
solved me
answered Apr 14, 2022 at 10:23
Victor OrletchiVictor Orletchi
4211 gold badge4 silver badges14 bronze badges
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.
answered Mar 25, 2021 at 14:50
MarcoMarco
7496 silver badges11 bronze badges
0
Run this command:
echo -e «nameserver 8.8.8.8nnameserver 8.8.4.4» |sudo tee -a /etc/resolv.conf
After that run-
sudo apt-get update
This worked for me.
answered May 20, 2022 at 6:30
1
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
answered May 3, 2020 at 4:57
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.
sɐunıɔןɐqɐp
3,14715 gold badges35 silver badges39 bronze badges
answered Jan 27, 2021 at 19:17
I was having the wrong DNS IP address in my /etc/docker/daemon.json. In my case, it was my home router DNS IP address and I was trying from the office network.
I found out my office DNS and updated with that.
{
"dns": ["192.168.1.1"]
}
Eric Aya
69.1k35 gold badges179 silver badges250 bronze badges
answered Jun 29, 2022 at 17:59
1
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
answered Jul 15, 2021 at 13:35
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.
answered Oct 9, 2021 at 22:02
MaxMax
4822 gold badges4 silver badges14 bronze badges
I had a similar issue, I tried many suggested solutions, but my issue was gone after I rebooted my VM.
Asclepius
54.5k16 gold badges157 silver badges139 bronze badges
answered Sep 2, 2020 at 14:30
babis21babis21
1,2951 gold badge15 silver badges27 bronze badges
I’m using Arch version 6.0.11 and docker version 20.10.21, and having this issues inside docker containers.
Thanks to @Marco, that was the initial hint to solve this. The problem is related to the use of extended ACLs in the host system.
The docker root folder has ACLs, you can see this as it has a plus sign at the end of permissions «+»:
$ sudo ls -lh /var/lib/docker
drw-rw-r--+ 3 root root 4.0K Nov 24 2021 network
And what is the problem? Some docker images does not have ACLs installed, so as it was pointed this causes an issue.
Other network tools like curl resolved DNS properly, but apt or git have problems with DNS resolution.
TLDR; Where is the fix? Modify ACL to set default rx to others.
setfacl -R -d -m o::rx /var/lib/docker
After that, all network tools will be able to perform DNS resolution.
Credits:
Marco comment
Closed git issue in docker
Antoine
1,3714 gold badges20 silver badges26 bronze badges
answered Dec 11, 2022 at 18:55
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.
asked May 2, 2020 at 22:58
Promise PrestonPromise Preston
21.1k11 gold badges127 silver badges128 bronze badges
1
Try restarting docker. 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.
answered Sep 24, 2020 at 20:14
4
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]
for docker-compose:
service_name:
container_name: name
build:
context: .
network: host
answered Mar 19, 2021 at 20:00
manumazumanumazu
6134 silver badges2 bronze badges
6
If you have VPN running, stop it and try again. It solved for me!
answered Aug 14, 2020 at 15:26
1
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.
Asclepius
54.5k16 gold badges157 silver badges139 bronze badges
answered May 2, 2020 at 22:58
Promise PrestonPromise Preston
21.1k11 gold badges127 silver badges128 bronze badges
1
sudo vi /etc/docker/daemon.json
and check flag of iptables, aslo add DNS if not added
{...., "iptables":true,"dns": ["8.8.8.8", "8.8.4.4"]}
then
sudo service docker restart
solved me
answered Apr 14, 2022 at 10:23
Victor OrletchiVictor Orletchi
4211 gold badge4 silver badges14 bronze badges
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.
answered Mar 25, 2021 at 14:50
MarcoMarco
7496 silver badges11 bronze badges
0
Run this command:
echo -e «nameserver 8.8.8.8nnameserver 8.8.4.4» |sudo tee -a /etc/resolv.conf
After that run-
sudo apt-get update
This worked for me.
answered May 20, 2022 at 6:30
1
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
answered May 3, 2020 at 4:57
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.
sɐunıɔןɐqɐp
3,14715 gold badges35 silver badges39 bronze badges
answered Jan 27, 2021 at 19:17
I was having the wrong DNS IP address in my /etc/docker/daemon.json. In my case, it was my home router DNS IP address and I was trying from the office network.
I found out my office DNS and updated with that.
{
"dns": ["192.168.1.1"]
}
Eric Aya
69.1k35 gold badges179 silver badges250 bronze badges
answered Jun 29, 2022 at 17:59
1
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
answered Jul 15, 2021 at 13:35
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.
answered Oct 9, 2021 at 22:02
MaxMax
4822 gold badges4 silver badges14 bronze badges
I had a similar issue, I tried many suggested solutions, but my issue was gone after I rebooted my VM.
Asclepius
54.5k16 gold badges157 silver badges139 bronze badges
answered Sep 2, 2020 at 14:30
babis21babis21
1,2951 gold badge15 silver badges27 bronze badges
I’m using Arch version 6.0.11 and docker version 20.10.21, and having this issues inside docker containers.
Thanks to @Marco, that was the initial hint to solve this. The problem is related to the use of extended ACLs in the host system.
The docker root folder has ACLs, you can see this as it has a plus sign at the end of permissions «+»:
$ sudo ls -lh /var/lib/docker
drw-rw-r--+ 3 root root 4.0K Nov 24 2021 network
And what is the problem? Some docker images does not have ACLs installed, so as it was pointed this causes an issue.
Other network tools like curl resolved DNS properly, but apt or git have problems with DNS resolution.
TLDR; Where is the fix? Modify ACL to set default rx to others.
setfacl -R -d -m o::rx /var/lib/docker
After that, all network tools will be able to perform DNS resolution.
Credits:
Marco comment
Closed git issue in docker
Antoine
1,3714 gold badges20 silver badges26 bronze badges
answered Dec 11, 2022 at 18:55
-
Léa Massiot
- Posts: 28
- Joined: 2011-10-16 12:30
Temporary failure resolving ‘deb.debian.org’
#1
Post
by Léa Massiot » 2020-11-27 14:49
Hi,
I am trying to update my Debian Buster machine.
My «/etc/apt/sources.lists» is:
Code: Select all
# Security updates
deb http://security.debian.org/ buster/updates main contrib non-free
deb-src http://security.debian.org/ buster/updates main contrib non-free
## Debian mirror
# Base repository
deb https://deb.debian.org/debian buster main contrib non-free
deb-src https://deb.debian.org/debian buster main contrib non-free
# Stable updates
deb https://deb.debian.org/debian buster-updates main contrib non-free
deb-src https://deb.debian.org/debian buster-updates main contrib non-free
# Stable backports
deb https://deb.debian.org/debian buster-backports main contrib non-free
deb-src https://deb.debian.org/debian buster-backports main contrib non-free
I am getting the errors below:
Code: Select all
root# apt-get update
Hit:1 http://security.debian.org buster/updates InRelease
Err:2 https://deb.debian.org/debian buster InRelease
Temporary failure resolving 'debian.map.fastly.net' Temporary failure resolving 'deb.debian.org'
Err:3 https://deb.debian.org/debian buster-updates InRelease
Temporary failure resolving 'debian.map.fastly.net' Temporary failure resolving 'deb.debian.org'
Err:4 https://deb.debian.org/debian buster-backports InRelease
Temporary failure resolving 'debian.map.fastly.net' Temporary failure resolving 'deb.debian.org'
Reading package lists... Done
W: Failed to fetch https://deb.debian.org/debian/dists/buster/InRelease Temporary failure resolving 'debian.map.fastly.net' Temporary failure resolving 'deb.debian.org'
W: Failed to fetch https://deb.debian.org/debian/dists/buster-updates/InRelease Temporary failure resolving 'debian.map.fastly.net' Temporary failure resolving 'deb.debian.org'
W: Failed to fetch https://deb.debian.org/debian/dists/buster-backports/InRelease Temporary failure resolving 'debian.map.fastly.net' Temporary failure resolving 'deb.debian.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.
Best regards.
Автор zema, 29 апреля 2020, 16:36:25
« назад — далее »
0 Пользователи и 1 гость просматривают эту тему.
Стоит файлопомойка на Debian c 6 версии обновлял до 9 и ядра пере собирал было всё нормально. Несколько месяцев назад ( может пол года) не стал работать apt-get update Ошибка «Следующие подписи не могут быть проверены, так как недоступен открытый ключ: NO_PUBKEY «
Никакие советы из интернета не помогали. Недавно дома с нуля переставил Debian 10 настроил основные службы, принёс на работу меняю подсеть на нужную (192.168.88 на 192.168.0 ) в /etc/network/interfaces и в /etc/resolv.conf . также побывал nameserver 8.8.8.8 в /etc/resolv.conf
и получаю ошибку:
Не удалось получить http://deb.debian.org/debian/dists/buster/InRelease Временная ошибка при разрешении «deb.debian.org»
Вроде бы DNS, но ping по именам проходит. Раньше в sources.list помогало смена имён на IP, но не в этот раз.
прописываю в apt.conf прокси и получаю Ошибку «Следующие подписи не могут быть проверены, так как недоступен открытый ключ: NO_PUBKEY «
То есть с чего начал тем и закончил.
Дома остался винт с Debian (на котором всё работает) клонирую приношу на работу ситуация повторяется, ставлю на другой компьютер тоже самое.
На роутере снимал все запрещающие правила ничего не меняется. Под Windows сеть работает без вопросов.
Приношу винт домой, меняю ip и apt-get update также не работает.
В чём может быть засада?
Ошибка явно в настройках сети, где конкретно — без понятия. т.к. наворотить можно что угодно.
они где то ещё есть кроме /etc/network/interfaces /etc/resolv.conf ?
Про ошибку с подписями репозиториев — покажите список источников /etc/apt/sources.list
- Русскоязычное сообщество Debian GNU/Linux
-
►
-
►
Общие вопросы -
►
apt-get update не работает
What does this show you?:
$ awk '{if($1=="hosts:")print;}' /etc/nsswitch.conf
And this?:
$ awk '{if($1=="nameserver")print;}' /etc/resolv.conf
Does the above show you one or more nameserver IP addresses with lines of 2 fields,first being the literal string nameserver and second being an IP address properly formatted
either as canonical IPv4 dotted quad or IPv6 form per the relevant RFCs, e.g. like:
127.0.0.1 and not 2130706433, or
2001:470:1f05:19e::2 and not 42540578174768546535349679483323940866
And, for the one or more IP addresses you got from the above from your /etc/resolv.conf file, can you in fact resolve against them — and also can you reach and connect to TCP port 53 on them (e.g. via telnet, nc, netmap — or even ssh specifying the target port and using the -v option so you can see if it connects or not).
If you have such connectivity, can you resolve against them, e.g.:
$ dig @IP_address_of_YOUR_nameserver +noall +answer +comments deb.debian.org. A deb.debian.org. AAAA
e.g.:
$ cat /etc/resolv.conf
nameserver 127.0.0.1
$ dig @127.0.0.1 +noall +answer +comments deb.debian.org. A deb.debian.org. AAAA
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33197
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 4, ADDITIONAL: 9
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: 6595d1d103dfba908016d85d60b31ac1b2dce7428ccd119d (good)
;; ANSWER SECTION:
deb.debian.org. 3370 IN CNAME debian.map.fastlydns.net.
debian.map.fastlydns.net. 30 IN A 151.101.42.132
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25639
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 4, ADDITIONAL: 9
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: 6595d1d103dfba908e9ca46860b31ac144a786b1c048bc46 (good)
;; ANSWER SECTION:
deb.debian.org. 3370 IN CNAME debian.map.fastlydns.net.
debian.map.fastlydns.net. 30 IN AAAA 2a04:4e42:a::644
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 4, ADDITIONAL: 9
$
If you don’t have dig you can install it from the dnsutlis package … «of course» that may be easiest to do if you first have working DNS. Alternatively to dig, if you have them installed, you might be able to use delv, nslookup, or hosts — but they each have their own syntax — Debian provides man pages — you can use them.
Issue
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.
Solution
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.
I hope this helps
Answered By — Promise Preston
