Docker networking #notetoself


  • List network setup: docker network ls
  • List: docker network inspect -f '{{range .IPAM.Config}}{{.Subnet}}{{end}}' [networkid]
  • List IPs of all containers.  docker network inspect -f '{{json .Containers}}' [networkid] | jq '.[] | .Name + ":" + .IPv4Address'
  • View host setup: docker exec [nameofnode] cat /etc/hosts
  • Running a named container: docker run -name api1 -p 8080:80 gcp-api

Installing ping in the container:
Setting up a network:

Docker networking for Dummies (like me)

Classic Setup (web, api, sql)

Setting up the classical environment of having the following 3 components, Web, API, SQL

A few extra notes

A note to self. Use remote command bash when the docker attach command hangs: docker exec -it [container-id] bash

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s