feat(shell): add dkip alias to the ip address of a container

This alias will inspect a container and pull out the ip address so you can get
to it on the network without having to bind ports.
This commit is contained in:
Ade Attwood 2021-06-26 20:47:25 +01:00
parent 6976cfe1fa
commit 67630dcbbf

View file

@ -30,6 +30,10 @@ function dktop() {
docker stats --format "table {{.Container}}\t{{.Name}}\t{{.CPUPerc}} {{.MemPerc}}\t{{.NetIO}}\t{{.BlockIO}}"
}
function dkip() {
docker inspect $1 | jq -r '.[0].NetworkSettings.Networks | .[].IPAddress'
}
#
# Docker Compose
#