chipmk / docker-mac-net-connect

Connect directly to Docker-for-Mac containers via IP address 🐳 💻
MIT License
402 stars 41 forks source link

IP Address command returns an empty string #14

Closed cisse21 closed 2 years ago

cisse21 commented 2 years ago

Architecture: Apple M1 Pro

Docker Compose file

version: "3.7"

services:
  d-transformer:
    depends_on:
      - metrics-exporter
    image: rudderlabs/rudder-transformer:latest 

Command

docker inspect rudder-server-d-transformer --format '{{.NetworkSettings.IPAddress}}'

The command returns an empty IPAddress. Can anyone help me out with this on why this might be happening?

vdlp-mw commented 2 years ago

I ran into the same problem. The format for getting the container IP address changed according to https://stackoverflow.com/a/20686101.

The new command should be: docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' rudder-server-d-transformer