I am trying to understand few things about Docker:
To see what network(s) your container is on, assuming your container is called c1
:
$ docker inspect c1 -f "{{json .NetworkSettings.Networks }}"
To disconnect your container from the first network (assuming your first network is called test-net
):
$ docker network disconnect test-net c1
Then to reconnect it to another network (assuming it's called test-net-2):
$ docker network connect test-net-2 c1
To check if two containers (or more) are on a network together:
$ docker network inspect test-net -f "{{json .Containers }}"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With