(container_id_or_name)
return run_command(command, capture='out', check=True).stdout.strip()
Get a Docker container's IP address from its ID or name.
Get a Docker container's IP address from its ID or name.
Get a Docker container s IP address from its ID or name .
def get_container_ip(container_id_or_name):
    """
    Get a Docker container's IP address from its ID or name.
    """
    command = [
        'docker',
        'inspect',
        '-f',
        '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}',
        container_id_or_name,
    ]

    return run_command(command, capture='out', check=True).stdout.strip()
def get_container_ip ( container_id_or_name ) : command = [ 'docker' , 'inspect' , '-f' , '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' , container_id_or_name , ] return run_command ( command , capture = 'out' , check = True ) . stdout . strip ( )