We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Break the Network

Let's quarantine a container and make sure that we can't reach the outside world.

The ping command allows you to check for connectivity to a host. For example we can ping google.com:

ping google.com

If everything is working, we'll see a response like:

64 bytes from 142.250.189.14: icmp_seq=0 ttl=119 time=13.636 ms
64 bytes from 142.250.189.14: icmp_seq=1 ttl=119 time=17.735 ms
64 bytes from 142.250.189.14: icmp_seq=2 ttl=119 time=17.691 ms

You can kill the ping command with Ctrl+C.

Assignment

docker run -d --network none docker/getting-started
docker exec CONTAINER_ID ping google.com -W 2

If all goes well, the program should hang for 2 seconds, then report an error message, because you don't have internet access!