this post was submitted on 03 Apr 2026
2 points (100.0% liked)

Docker

1426 readers
4 users here now

founded 2 years ago
MODERATORS
 

Full disclosure: I'm very new and very dumb. So. Bear that in mind.

I'm running Docker on Ubuntu Server 24.04 LTS. I installed it according to the official directions provided by Docker. The container example I'll refer to here is Beets, but same happens on Calibre Web Automated and a couple other containers I tried.

Basically, from within the container I can't ping google. This:

docker exec -it beets ping -c 3 google.com

returns:

PING google.com (142.250.113.138): 56 data bytes google.com ping statistics: 3 packets transmitted, 0 packets received, 100% packet loss

So, in Beets case, it can't access musicbrainz to do.. well, anything it's built to do, because it (and any other container I run) doesn't seem to be able to access the internet? Idk.

I've tried a whole bunch of stuff at this point (not really knowing what any of it means, mind you) and nothing has worked. I've checked /etc/resolved.conf, which just lists 127.0.0.53, which is apparently some sort of systemd DNS cache? Ngl, I don't really know what that means, but a potential solution I read was to override it by editing /etc/docker/daemon.json to include something like dns: [8.8.4.4, 8.8.8.8] (I don't recall the exact syntax, sorry). Anyway, that was even worse, because running the ping from inside the container then didn't resolve an IP for google at all and just said "bad address". I tried making a user-defined bridge, which output the exact same as above: 100% packet loss. I tried rebuilding the iptables, nothing. Directing containers to a network in the compose yml, restarting containers, restarting docker, rebooting. Idk.

Only thing that seems to work is adding network_mode: "host" to the container's compose yml, which... I mean, if that's the solution that works, that's what I'll do. But I'm wondering what exactly is going wrong otherwise, and if I can fix it.

Any help greatly appreciated.

you are viewing a single comment's thread
view the rest of the comments
[–] moonpiedumplings@programming.dev 3 points 21 hours ago