PostgreSQL
 sql >> Datenbank >  >> RDS >> PostgreSQL

Docker Compose und Postgres:Name wird nicht aufgelöst

Sie müssen bind-tools installieren in Dockerfile-dev für Name does not resolve Problem:

apk add bind-tools 

Test:

/usr/src/app # nslookup users-db
nslookup: can't resolve '(null)': Name does not resolve

Name:      users-db
Address 1: 172.20.0.2 stc_users-db_1_f435854a8c88.stc_default
/usr/src/app # apk add bind-tools
(1/4) Installing json-c (0.13.1-r0)
(2/4) Installing libxml2 (2.9.8-r1)
(3/4) Installing bind-libs (9.12.3-r0)
(4/4) Installing bind-tools (9.12.3-r0)
Executing busybox-1.28.4-r3.trigger
OK: 188 MiB in 62 packages
/usr/src/app # nslookup users-db
Server:         127.0.0.11
Address:        127.0.0.11#53

Non-authoritative answer:
Name:   users-db
Address: 172.20.0.2