Docker network related research & configuration commands
at first
Make a note of network-related commands that you always forget
- Scheduled to be added at any time
Research
Investigate the network group to which a specific container belongs
docker inspect --format '{{ .NetworkSettings.Networks }}' [Container name]
Investigate the internal IP address of a specific container
docker inspect --format '{{ .NetworkSettings.Networks.[Affiliation network group name].IPAddress }}' [Container name]
- Group name and container name must be the same
- Displayed when hostname -i is executed in the container
Configuration
Add network group to specific container
docker network connect [Network group] [Container name]