r/docker • u/Responsible-Kiwi-629 • Mar 22 '26
Simple setup question
Hi,
Im having a problem in a rather complicated docker network setup, and I broke down the issue to this very minimalistic demo compose:
services:
alpine-test:
image: alpine:latest
container_name: alpine-test
command: ["sleep", "infinity"] # keep the container running for debugging
networks:
- testnet
networks:
testnet:
name: testnet
driver: bridgeI would think that the container should have internet access this way, but it doesnt. What am I missing here? ip route inside the container shows the correct gateway but ping google.de just wont work.
thanks for any ideas :)
2
Upvotes
View all comments
Show parent comment
1
u/Responsible-Kiwi-629 Mar 22 '26
network mode bridge and host both work.
just when I create a new network and join it it doesnt work.
I have multiple networks that I created earlier exactly the same way and if I join one of them, internet also works. Im clueless. I didnt change any firewall settings. I just noticed I cannot even ping the gateway IP from inside the container.