Docker¶
Interactive shell in container¶
Bash¶
POSIX shell¶
Container IP¶
Prints a container's IP, along with the name of the network.
docker inspect -f '{{range $name, $net := .NetworkSettings.Networks}}{{printf "%-15s %s\n" $name $net.IPAddress}}{{end}}' <container>
Output: