Docker Community Forums

Share and learn in the Docker community.

No external connection with container on VM with CentOS 8

I just have setup VirtualBox on my MAC with CentOS 8 server and installed docker. I downloaded latest Jenkins container and tried to run it. But I always receive an failure with resolving ip for update site when calling docker run jenkins command.

[root@centos-server ~]# docker run jenkins 
...
Mar 31, 2020 2:41:40 PM hudson.model.UpdateCenter updateDefaultSite
WARNING: Upgrading Jenkins. Failed to update the default Update Site 'default'. Plugin upgrades may fail.
java.net.UnknownHostException: updates.jenkins-ci.org
...

Running ping shows that ip address doesn’t seem to get resolved. Calling www.google.de doesn’t work but corresponding ip address 172.217.20.227 is working. But wget also has problems.

[root@centos-server ~]# docker run jenkins ping google.de 
ping: google.de: Temporary failure in name resolution
...
[root@centos-server ~]# docker run jenkins ping 172.217.20.227
PING 172.217.20.227 (172.217.20.227) 56(84) bytes of data.
64 bytes from 172.217.20.227: icmp_seq=1 ttl=61 time=9.53 ms
64 bytes from 172.217.20.227: icmp_seq=2 ttl=61 time=10.0 ms
...
[root@centos-server ~]# docker run jenkins wget 172.217.20.227
--2020-03-31 15:15:50-- http://172.217.20.227/
Connecting to 172.217.20.227:80... failed: No route to host.

I studied the internet and tried several adjustements to resolv.conf, stop firewall or similar. But nothing helped.
Using --network host is also no solution because I want to provide 8080 port for external use of Jenkins in my vm with -p 8080:8080 command. Combination of both parameters is not possible.

Then I gave it another try by using another VM in my Virtualbox having Ubuntu Desktop installed. I also installed docker and there I receive no problem. Jenkins container is able to connect to update site. Also ping is possible.

ahager@ubuntu-vm:~$ docker run jenkins ping google.de -c 4
PING google.de (172.217.22.227) 56(84) bytes of data.
64 bytes from muc11s02-in-f3.1e100.net (172.217.22.227): icmp_seq=1 ttl=61 time=9.14 ms
64 bytes from muc11s02-in-f3.1e100.net (172.217.22.227): icmp_seq=2 ttl=61 time=9.56 ms
64 bytes from muc11s02-in-f3.1e100.net (172.217.22.227): icmp_seq=3 ttl=61 time=11.0 ms
64 bytes from muc11s02-in-f3.1e100.net (172.217.22.227): icmp_seq=4 ttl=61 time=11.3 ms

--- google.de ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3027ms
rtt min/avg/max/mdev = 9.147/10.277/11.341/0.949 ms

Anybody has an idea what could be the problem? Both host systems, CentOS and Ubuntu, can access internet. But there seems to be a problem with routing or DNS on CentOS server compared to Ubuntu desktop.
Which files or configuration should I check?

1 Like