Docker dpage/pgadmin4错误:指定的用户不存在

编程入门 行业动态 更新时间:2024-10-28 14:29:50
本文介绍了Docker dpage/pgadmin4错误:指定的用户不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

这是 docker-compose.yml 文件:

version: '3' services: ############################ # Setup database container # ############################ postgres_db: image: postgres restart: always ports: - ${POSTGRES_PORT}:${POSTGRES_PORT} environment: - POSTGRES_USER=${POSTGRES_USER} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - PGDATA=/var/lib/postgresql/data/pgdata - POSTGRES_DB=${POSTGRES_DB} volumes: - ./data:/var/lib/postgresql/data networks: - db_network pgadmin: image: dpage/pgadmin4:4.19 restart: always ports: - 8001:8080/tcp environment: - PGADMIN_LISTEN_ADDRESS=0.0.0.0 - PGADMIN_LISTEN_PORT=8080 - PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL} - PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD} networks: - db_network networks: db_network: driver: bridge

同一目录中有一个 .env 文件.

There is a .env file in the same directory.

# The above refers to the name of the postgres container since using docker-compose # This is because docker-compose creates a user-defined network. Kubernetes also does this. POSTGRES_PORT=5432 POSTGRES_USER=website POSTGRES_PASSWORD=website POSTGRES_DB=wikifakes_main PGADMIN_DEFAULT_EMAIL=info@my-website PGADMIN_DEFAULT_PASSWORD=my-secure-password

在执行 docker-compose up --build 时,docker start和我都可以通过 localhost:8001 访问pgAdmin4网站.但是,输入凭据后,我得到以下响应:

When executing docker-compose up --build both docker start and I can access the pgAdmin4 website via localhost:8001. However, after entering the credentials, I get the following response:

指定的用户不存在

为什么指定的用户不存在,如何更改环境以登录?

Why does the specified user not exist and how should I change my environment so that I can log in?

通过 docker创建的 pgadmin4 docker上的登录运行--rm -e PGADMIN_DEFAULT_EMAIL ="info@my-website" -e PGADMIN_DEFAULT_PASSWORD ="my-secure-password"-p 8001:80 dpage/pgadmin4 正常运行.

The login on an pgadmin4 docker created via docker run --rm -e PGADMIN_DEFAULT_EMAIL="info@my-website" -e PGADMIN_DEFAULT_PASSWORD="my-secure-password" -p 8001:80 dpage/pgadmin4 works alright though.

推荐答案

在docker-compose.yml文件中的 pgadmin 服务中添加 tty:true .>

Add tty: true to the pgadmin service in the docker-compose.yml file.

pgadmin: image: dpage/pgadmin4:4.19 restart: always ports: - 8001:8080/tcp environment: - PGADMIN_LISTEN_ADDRESS=0.0.0.0 - PGADMIN_LISTEN_PORT=8080 - PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL} - PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD} networks: - db_network # ADD THIS LINE tty: true

因此完整的文件如下所示:

So the complete file will look as follows:

version: '3' services: ############################ # Setup database container # ############################ postgres_db: image: postgres restart: always ports: - ${POSTGRES_PORT}:${POSTGRES_PORT} environment: - POSTGRES_USER=${POSTGRES_USER} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - PGDATA=/var/lib/postgresql/data/pgdata - POSTGRES_DB=${POSTGRES_DB} volumes: - ./data:/var/lib/postgresql/data networks: - db_network pgadmin: image: dpage/pgadmin4:4.19 restart: always ports: - 8001:8080/tcp environment: - PGADMIN_LISTEN_ADDRESS=0.0.0.0 - PGADMIN_LISTEN_PORT=8080 - PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL} - PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD} networks: - db_network # ADD THIS LINE, TO BE ABLE TO LOGIN tty: true networks: db_network: driver: bridge

更多推荐

Docker dpage/pgadmin4错误:指定的用户不存在

本文发布于:2023-10-23 15:54:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1521310.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不存在   错误   用户   Docker   dpage

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!