0

Here is my docker-compose file:

version: '2' services: app: image: mykiwi/ttrss database: image: postgres:10-alpine environment: - POSTGRES_USER=ttrss - POSTGRES_PASSWORD=ttrss volumes: - database:/var/lib/postgresql/data volumes: database: ~ 

But when I inspect my main container, there is no ip address:

$ docker inspect 40f78d12c178 ... "NetworkSettings": { "Bridge": "", "SandboxID": "70479dc6e987e744e376f6e4222e8d26174b724b686da52924a7e539ef4d4f0c", "HairpinMode": false, "LinkLocalIPv6Address": "", "LinkLocalIPv6PrefixLen": 0, "Ports": {}, "SandboxKey": "/var/run/docker/netns/70479dc6e987", "SecondaryIPAddresses": null, "SecondaryIPv6Addresses": null, "EndpointID": "", "Gateway": "", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "IPAddress": "", "IPPrefixLen": 0, "IPv6Gateway": "", "MacAddress": "", "Networks": { "none": { "IPAMConfig": null, "Links": null, "Aliases": null, "NetworkID": "2c6c546b04398c4b4c7b9e52fdb16b89aacfea33b9038b6aa90b4b44fbd99ac7", "EndpointID": "ac4da8b1b38118732a6e9e99a0ba56b271e6810afd78975c5f329185cf047bf7", "Gateway": "", "IPAddress": "", "IPPrefixLen": 0, "IPv6Gateway": "", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "MacAddress": "", "DriverOpts": null } } } } ] 

I run it through rancher, is it related ?

1 Answer 1

1

Rancher uses CNI drivers for networking and so the network is "none" as far as Docker is concerned and no IP addresses or port info appears in Docker inspect. You can get it from the metadata service.

Sign up to request clarification or add additional context in comments.

1 Comment

Ok. I use Traefik in front, and access to container through it and the docker backend. Should I set a rancher backend too? Because without container ip I can't access them like I do with basic docker containers

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.