Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»General Articles»How to Get IP Address of A Docker Container

    How to Get IP Address of A Docker Container

    By RahulApril 10, 20201 Min Read

    This tutorial will help you to get the IP address of a Docker container on your system. The docker binary provides network option to manage networking for the docker environment. Also, you can use inspect option to find the details of a Docker container. In this tutorial, we use inspect option to fetch docker container IP address via command line.

    Advertisement

    Syntax

    Use below syntax to get IP address of a Docker container. You need to change CONTAINER ID/NAME with the actual container ID or name.

    docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <CONTAINER ID/NAME>
    

    Example

    For example, you have a docker container with the container id 1808352f0693. Just run the below command on terminal.

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

    Output

    172.17.0.2
    

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    How To Block Specific Keywords Using Squid Proxy Server

    How To Block Specific Domains Using Squid Proxy Server

    A Comprehensive Look at the Simple Mail Transfer Protocol (SMTP)

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Setting Up Angular on Ubuntu: Step-by-Step Guide
    • Converting UTC Date and Time to Local Time in Linux
    • Git Restore: Functionality and Practical Examples
    • Git Switch: Functionality and Practical Examples
    • Git Switch vs. Checkout: A Detailed Comparison with Examples
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.