Well, I think the problem is because I installed docker tools from snap on Debian machine. I tried other containers:
docker run --name my-debian -it debian:bookworm-slim bas
docker run --name my-ubuntu -it ubuntu bash
The result is exactly the same. So it’s not related to CGE docker file.
While I also tried on Ubuntu host machine with normally installed docker tools - CGE container works fine.
Those VMs network adapters are NAT. Not sure why that fixes it, but it does.
In my Virtual Box usage, I see my network cards are indeed NAT.
As for Docker from snap – personally I’m always installing it using DEB packages, following Install Docker Engine on Ubuntu | Docker Docs . This approach has worked for me. So, as you say, maybe the problem is because of snap? Switching your installation to use DEB packages and testing should answer this.