[英]Address not available Is the server running on that host and accepting TCP/IP connections?
I am using PostgreSQL 14.4 inside Docker, and pgAdmin inside Docker for Windows.我在 Docker 中使用 PostgreSQL 14.4,在 Docker for Windows 中使用 pgAdmin。
My command I used我使用的命令
docker run -d --name vy_posgres_for_acc -p 5432:5432 -e POSTGRES_PASSWORD=postgres -e POSTGRES_USER=postgres -e PGDATA=D:\docker_mount\postgres\data postgres:latest
docker run -d -p 5050:80 -e PGADMIN_DEFAULT_EMAIL=donhuvy@hotmail.com -e PGADMIN_DEFAULT_PASSWORD=postgres dpage/pgadmin4:latest
# Go to http://localhost:5050/login PG admin 6.10
Error of pgAdmin pgAdmin 的错误
Address not available Is the server running on that host and accepting TCP/IP connections?
How to fix it?如何解决?
Since you have multiple containers you want to use together, one way to handle things like this is to use Docker Compose .由于您有多个要一起使用的容器,因此处理此类事情的一种方法是使用Docker Compose 。 You create a Compose file, which is a YAML file declaring your containers.
您创建一个 Compose 文件,它是一个用于声明您的容器的 YAML 文件。 When you use
docker compose
to start them, it will create a network for you containing all the containers.当您使用
docker compose
启动它们时,它将为您创建一个包含所有容器的网络。 They'll then be able to access each other by host name (which defaults to the service name you use in the Compose file).然后,它们将能够通过主机名(默认为您在 Compose 文件中使用的服务名称)相互访问。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.