5 virtualization virtualbox docker docker-toolbox
我正在运行Docker Toolbox v. 1.13.1a的Windows 7 Pro Service pack 1 x64操作系统.同Virtual Box Version 5.1.14 r112924
当我尝试运行任何泊坞窗图像时,例如official postgres image从Docker Hub禁用卷,它工作正常!
但是,当我enable the volumes是失败.
我尝试了所有官方文件
在VM共享文件夹作为需要,并且具有full access到它也
共享文件夹的屏幕截图
在我的postgresql示例的情况下,它崩溃与以下 log
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
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".
Data page checksums are disabled.
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
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... LOG: could not link file "pg_xlog/xlogtemp.27" to "pg_xlog/000000010000000000000001": Operation not permitted
FATAL: could not open file "pg_xlog/000000010000000000000001": No such file or directory
child process exited with exit code 1
initdb: removing contents of data directory "/var/lib/postgresql/data"
Run Code Online (Sandbox Code Playgroud)
我知道它的问题folder permissions.但有点卡住了!一吨的感谢提前
我一整天都忙于解决这个问题,我的结论是,目前根本不可能在 docker 容器内运行 postgresql,同时将数据持久保存在单独的卷中。
我什至尝试在不链接到卷的情况下运行容器,并将最初位于 /var/lib/postgresql 中的数据复制到我的主机操作系统(Windows 10 Home)的文件夹中,然后将其复制到随后链接到的文件夹中容器本身。
唉,我得到了下一个错误:
FATAL: data directory "/var/lib/postgresql/data/pgadmin" has wrong ownership
HINT: The server must be started by the user that owns the data directory.
Run Code Online (Sandbox Code Playgroud)
结论:所有权和拥有它的正确用户出了问题,并且为了能够修复它,您需要一个能够运行 docker 的 Windows 上的 unix 命令行(目前 Windows 上的 Ubuntu 上的 Bash 无法做到这一点)使用 Ubuntu 16.04 二进制文件运行)。
也许,将来您将能够运行所需的命令(可在此处找到,在 下Arbitrary --user Notes),但这些是 *nix 命令,而 powershell(由 Kitematic 启动)无法运行这些命令。Bash for Ubuntu for Windows可以运行这些,但该 shell 与 Windows 上的 docker 守护进程/服务没有连接......
TL;DR:失去一天的工作:目前在 Windows 上这是不可能的。
| 归档时间: |
|
| 查看次数: |
996 次 |
| 最近记录: |