I'm trying to debug some docker containers that aren't allowing outgoing connections. The docker documentation says that allowing outgoing connections is the default behavior of the default bridge network driver, but that the none driver does not allow outgoing connections. I'd like to be able to check which network driver these containers are using, but I haven't been able to find the right switches in docker ps (or any other command) that would allow me to do this.
How can I get the network driver for a particular docker container from the command line?
Use
docker container inspectto view theNetworkModeattribute of the container:This will either be:
hostwhen running with--net=hostnonewhen running with--net=nonedefaultwhen using the default bridge networkcontainer:<id>when using the namespace of another container