【发布时间】:2021-02-23 02:52:37
【问题描述】:
我遇到了与post 中描述的相同的问题,但在 docker 容器中。 我真的不知道我的 pgadmin 文件驻留在哪里来编辑它的默认路径。我该如何解决这个问题?请尽可能详细,因为我不知道如何 docker。
这里是docker-compose up命令的逐字摘要:
php-worker_1 | 2020-11-11 05:50:13,700 INFO spawned: 'laravel-worker_03' with pid 67
pgadmin_1 | [2020-11-11 05:50:13 +0000] [223] [INFO] Worker exiting (pid: 223)
pgadmin_1 | WARNING: Failed to set ACL on the directory containing the configuration database:
pgadmin_1 | [Errno 1] Operation not permitted: '/var/lib/pgadmin'
pgadmin_1 | HINT : You may need to manually set the permissions on
pgadmin_1 | /var/lib/pgadmin to allow pgadmin to write to it.
pgadmin_1 | ERROR : Failed to create the directory /var/lib/pgadmin/sessions:
pgadmin_1 | [Errno 13] Permission denied: '/var/lib/pgadmin/sessions'
pgadmin_1 | HINT : Create the directory /var/lib/pgadmin/sessions, ensure it is writeable by
pgadmin_1 | 'pgadmin', and try again, or, create a config_local.py file
pgadmin_1 | and override the SESSION_DB_PATH setting per
pgadmin_1 | https://www.pgadmin.org/docs/pgadmin4/4.27/config_py.html
pgadmin_1 | /usr/local/lib/python3.8/os.py:1023: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used
pgadmin_1 | return io.open(fd, *args, **kwargs)
pgadmin_1 | [2020-11-11 05:50:13 +0000] [224] [INFO] Booting worker with pid: 224
我的 docker-compose.yml:
### pgAdmin ##############################################
pgadmin:
image: dpage/pgadmin4:latest
environment:
- "PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL}"
- "PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD}"
ports:
- "${PGADMIN_PORT}:80"
volumes:
- ${DATA_PATH_HOST}/pgadmin:/var/lib/pgadmin
depends_on:
- postgres
networks:
- frontend
- backend
【问题讨论】:
-
您是否在容器内挂载本地主机数据文件夹?你完成这一步了吗? pgadmin.org/docs/pgadmin4/latest/…
-
@rzlvmp 我该如何确认?对不起,我不知道码头工人..
-
如何运行 docker 容器?通过命令行?你能提供命令吗?啊好吧。您正在使用 docker-compose。请提供 docker-compose.yml 描述(不要忘记删除敏感信息)。
-
@rzlvmp 敏感数据我认为是由我必须在此步骤之前运行的脚本设置为环境变量