Launching containers with no network
Docker inherently supports three types of network (bridge
, hosts
, and none
), as is evident in the following docker network ls
command output:

In the previous recipes, we discussed the bridge
and host
networking capability. Nonetheless, the none
network modecomes in handy when you package any utility inside the container that doesn't need any network connectivity. Besides, the none
network modecan also be used to do your custom network plumbing without involving the Docker. In this recipe, we will launch a container with the none
network modeand explore the container's network details.
Getting ready
Before we begin, ensure that the Docker daemon is running and has access to the alpine image.
How to do it...
Launch a container with no network by using the --net none
argument in the docker container run
command, as shown in the following screenshot:

Apparently, when we launch a container with the network mode set to none
, Docker only creates a loopback
interface...