Link to home
Start Free TrialLog in
Avatar of NAMEWITHELD12
NAMEWITHELD12Flag for United States of America

asked on

How can I grep a Dockerfile in windows for the container IP ?

I want to use the command "docker inspect <container name> and just return the IP address .

the Linux command to to this is "docker inspect <container name | grep IPAddress "

what is the windows way to do this ?

thanks !!
Avatar of Chris Dent
Chris Dent
Flag of United Kingdom of Great Britain and Northern Ireland image

The closest Windows cmd comes is FindStr.

PowerShell gets Select-String which is a bit more powershell.

Either can be used as a simple (not anywhere near as complex) substitute for grep.

It's difficult to advise further, I don't have docker so I couldn't tell you if there's a better way.
Avatar of NAMEWITHELD12

ASKER

thanks can you use FindStr in an example ?

thanks!!!!!!!!
SOLUTION
Avatar of Chris Dent
Chris Dent
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Perfect man !!! thanks !!!!

PS C:\Users\Administrator> docker inspect ff8 | FindStr IPAddress
            "SecondaryIPAddresses": null,
            "IPAddress": "",
                    "IPAddress": "172.17.254.209"
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Need comment from NAMEWITHELD12 and Administrator to close this query.
Need comment from NAMEWITHELD12 and Administrator to close this query.
Comment if any objection.