Docker Network
Single docker host
host ip: 192.168.1.10
NONE network #docker run --network none nginx no entry to the image
Host network #docker run --network host nginx host 80 port will be used by docker. Only can start one nginx
Bridge network(default) #docker run nginx every docker container will have one namespace in it
docker0
172.17.0.1
Bridge network
check the network after starting docker service: #systemctl start docker.service


start docker container: #docker run nginx
check docker container id #docker ps -a
inspect the container find network information #docker inspect <container id>
in the docker host visit works #curl http://<containerip>:80
outside docker host visit need mapping when start docker container #docker run -p 8080:80 nginx
#curl http://<hostip>:8080
Comments
Post a Comment