We help IT Professionals succeed at work.

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

792 Views
Last Modified: 2017-05-02
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 !!
Comment
Watch Question

Chris DentPowerShell Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
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.

Author

Commented:
thanks can you use FindStr in an example ?

thanks!!!!!!!!
Chris DentPowerShell Developer
CERTIFIED EXPERT
Top Expert 2010
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Perfect man !!! thanks !!!!

PS C:\Users\Administrator> docker inspect ff8 | FindStr IPAddress
            "SecondaryIPAddresses": null,
            "IPAddress": "",
                    "IPAddress": "172.17.254.209"
Application Development and Automation Management
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
MURUGESAN NApplication Development and Automation Management
CERTIFIED EXPERT

Commented:
Need comment from NAMEWITHELD12 and Administrator to close this query.
MURUGESAN NApplication Development and Automation Management
CERTIFIED EXPERT

Commented:
Need comment from NAMEWITHELD12 and Administrator to close this query.
MURUGESAN NApplication Development and Automation Management
CERTIFIED EXPERT

Commented:
Comment if any objection.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.