ubuntu – Cannot apt-get update from inside my docker container if connected to bridge network

I am trying to understand, why I am unable to run apt-get update from within my docker containers, either debian:latest or ubuntu:latest.

  • I am able to ping 8.8.8.8 or other address from within the container
  • I am able to ping google.com or other domains from within the container
  • apt-get update works if I start the container with --network host
  • apt-get update does not work if the container is connected to the default bridge network or any other user defined network with adapter set to bridge
  • The host is a virtual machine managed by openstack
  • Everything works as expected on my computer (not openstack, not virtual)

apt-get update will time out with:

root@66230c3e7572:/# apt update
Err:1 http://deb.debian.org/debian buster InRelease                           
  Connection failed (IP: 199.232.138.132 80)
Err:2 http://security.debian.org/debian-security buster/updates InRelease
  Connection failed (IP: 151.101.194.132 80)
Err:3 http://deb.debian.org/debian buster-updates InRelease              
  Connection failed (IP: 199.232.138.132 80)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease  Connection failed (IP: 199.232.138.132 80)
W: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease  Connection failed (IP: 151.101.194.132 80)
W: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/InRelease  Connection failed (IP: 199.232.138.132 80)
W: Some index files failed to download. They have been ignored, or old ones used instead.

I would like to find out why apt-get udpate is not working while I’m connected to any bridge network on the virtual machine. So any hints on how to debug this problem are very appreciated.