Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

docker ps with ip

# The --format option of inspect comes to the rescue.

# Modern Docker client syntax is:

docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name_or_id

#Old Docker client syntax is:

docker inspect --format '{{ .NetworkSettings.IPAddress }}' container_name_or_id
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #docker #ps #ip
ADD COMMENT
Topic
Name
8+6 =