Restrict Internet Access — Docker Container

Network creation for access internet

docker network create —subnet=172.19.0.0/16 internet

Network creation for block internet access

docker network create —internal —subnet 10.1.1.0/24 no-internet

If you want to connect docker container into internet

docker network connect internet container-name

If you want to block internet access

docker network connect no-internet container-name