By default, containers are connected to the bridge network, but you can choose which network to use when starting a container.
Here is an example of running a container using the default bridge network:
docker run --name my_nginx --network bridge -p 8080:80 -d nginx
NOTE:
The Nginx container is accessible via localhost:8080.
NOTE: If the Nginx image is not already present on the local system, Docker will first check the Docker Hub to pull the nginx image.
curl http://localhost:8080
NOTE: This should show a default HTML web page that nginx uses.