My host machine is Ubuntu. VirtualBox is installed.
In VirtualBox I have a Debian machine.
In the Debian machine I run the container:
docker run --name my-cge-container --volume="${HOME}":/home/sharedhome/ -it kambi/castle-engine-cloud-builds-tools:cge-unstable bash
Everything is OK. There is Internet connection in the container.
After container runs for about 1 minute:
There is no Internet connection inside the container,
and no Internet in Debian machine, while there is Internet in Ubuntu host machine.
I stop container. Immediately there is Internet in Debian machine.
Start the container again. The situation repeats - no internet after 1 minutes and Internet is available after stopping container.
I repeated it several times/restarted Debian machine etc.
I installed docker tools via snap on the Debian machine. Maybe this is the problem while I am not sure. Maybe it’s something with Castle’s Dockerfile.
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.