why docker networking is important?

One thing about Docker is, it makes it very easy to deal with containers and managing them. Simple by an one-liner we can run any container like so:

docker container run -dp 80:80 nginx:alpine

Want to have ten Nginx running simultaneously? No problem

for N in {1..10}; do
    docker container run --rm -dp 8${N}:80 --name nginx_${N} nginx:alpine
done

And here is a shot of it:

Or the output:

So not just 10 containers we can run as many as we want but what do they do for us? If you have 10 or 1000 Nginx containers? And from now networking comes to the play because if we want to join to different containers to communicate with each other we have to connect them to each other and this connection is possible through networking.

The bigger or the more complex our containers' communication is, the more depth understanding is needed about networking. Thus lets go to next part.

Last updated

Was this helpful?