gpt4 book ai didi

Postgresql docker卷在Windows上失败

转载 作者:行者123 更新时间:2023-12-02 19:30:42 33 4
gpt4 key购买 nike

我的 Macbook 中有一个正在运行的 docker,使用以下脚本:

version: '2'
services:
nginx:
image: nginx:latest
container_name: nz01
ports:
- "8000:8000"
volumes:
- ./src:/src
- ./config/nginx:/etc/nginx/conf.d
depends_on:
- web
web:
build: .
container_name: dz01
depends_on:
- db
volumes:
- ./src:/src
expose:
- "8000"
db:
image: postgres:latest
container_name: pz01
ports:
- "5433:5432"
volumes:
- ./postgres-data:/var/lib/postgresql/data

当我在没有 Hyper-V 的 Windows 10 上复制它时,所以我使用 docker 工具箱时,postgres 容器失败并显示以下日志:
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
2018-07-25T16:05:53.723099340Z
The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
2018-07-25T16:05:53.723133181Z
Data page checksums are disabled.
2018-07-25T16:05:53.723144716Z
fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
2018-07-25 16:05:55.787 UTC [30] LOG: could not link file "pg_wal/xlogtemp.30" to "pg_wal/000000010000000000000001": Operation not permitted
2018-07-25 16:05:55.792 UTC [30] FATAL: could not open file "pg_wal/000000010000000000000001": No such file or directory
child process exited with exit code 1
initdb: removing contents of data directory "/var/lib/postgresql/data"
running bootstrap script ..

为了得到这个日志,我删除了 /postgres-data我的windows文件夹中的目录,因为之前我在引用用户权限时出错,所以我想到了删除文件夹,Docker会自动生成该文件夹。

我用谷歌搜索我得到的错误,我找不到任何相关的,所以我不知道为什么会发生它......

有什么帮助吗?

最佳答案

最后我解决了。

我重新启动整个计算机,删除 repo 并从 desktop 重新开始。 .正如我在 Docker 文档中看到的那样,该文件夹必须位于公共(public)路径中,例如 C:/Users/YourUser
在那之后,我没有任何问题。

关于Postgresql docker卷在Windows上失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51523420/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com