在启用卷时,无法启动任何容器Docker Toolbox [英] Unable to start any container when Volumes are enabled Docker Toolbox

查看:994
本文介绍了在启用卷时,无法启动任何容器Docker Toolbox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行 Docker Toolbox v。1.13.1a on Windows 7 Pro Service Pack 1 x64 操作系统。
虚拟盒子版本5.1.14 r112924



当我尝试运行任何泊坞窗图像 c $ c $ / $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ >启用卷它失败



我尝试所有官方文档



虚拟机根据需要具有共享文件夹,并且完全访问也是
共享文件夹截图



如果我的postgresql示例,它会崩溃与以下 log

 属于此数据库系统的文件将由用户postgres 。 
该用户还必须拥有服务器进程。
数据库集群将使用localeen_US.utf8进行初始化。
因此,默认数据库编码设置为UTF8。
默认文本搜索配置将设置为english。
数据页校验和被禁用。
修复现有目录的权限/ var / lib / postgresql / data ... ok
创建子目录... ok
选择默认max_connections ... 100
选择默认的shared_buffers。 ... 128MB
选择动态共享内存实现... posix
选择默认max_connections ... 100
选择默认shared_buffers ... 128MB
选择动态共享内存实现... posix
创建配置文件... ok
运行引导脚本...日志:无法将文件pg_xlog / xlogtemp.27链接到pg_xlog / 000000010000000000000001:不允许操作
致命:无法打开文件pg_xlog / 000000010000000000000001:没有这样的文件或目录
子进程退出与退出代码1
initdb:删除数据目录/ var / lib / postgresql / data的内容

我知道它的问题与 文件夹权限 即可。但有点卡住了!
提前一吨谢谢

解决方案

我一直在忙这个问题所有的一天,我的结论是,目前根本无法在docker容器中运行postgresql,同时保持数据在单独的卷中保持。



我甚至尝试运行容器没有链接到卷并将最初在/ var / lib / postgresql中的数据复制到我的主机操作系统(Windows 10 Home)的文件夹中,然后将 复制到文件夹中,然后链接到容器本身。



唉,我收到了下一个错误:

  FATAL:数据目录/ var / lib / postgresql / data / pgadmin具有错误的所有权
提示:服务器必须由拥有数据目录的用户启动。

总而言之:所有权和正确的用户拥有它会出现问题,并且能够修复它,您需要在Windows上运行一个unix命令行,可以运行docker(在Ubuntu上的Bash上使用Ubuntu 16.04二进制文件运行的Bash现在不可用)。



也许今后可以运行所需的命令(这里,在任意 - 用户注释下),但这些是* nix命令和powershell(由Kitematic启动)无法运行。 Bash的Ubuntu for Windows可以运行这些,但是shell没有连接到windows上的docker守护程序/服务...



TL; DR:失去一天的工作:Windows目前是不可能的。


I am running Docker Toolbox v. 1.13.1a on Windows 7 Pro Service pack 1 x64OS. with Virtual Box Version 5.1.14 r112924

when I try to run any docker image e.g. official postgres image from Docker Hub with volumes disabled, it works fine!

But when I enable the volumes it fails.

I tried all official documentations

The VM has shared folder as required and has full access to it also shared folder screenshot

In case of my example of postgresql it crashes with following 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"

I know its the problem with folder permissions. But kinda stuck! A ton of thanks in advance

解决方案

I've been busy with this problem all day and my conclusion that it's currently simply not possible to run postgresql inside a docker container while keeping your data persistent in a separate volume.

I even tried running the container without linking to a volume and copying the data that was originally in /var/lib/postgresql into a folder of my host OS (Windows 10 Home), then copy that into the folder that got then linked to the container itself.

Alas, I got the next error:

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.

In conclusion: There's something going wrong with the ownership and the correct user owning it and to be able to fix it, you'll need a unix commandline on Windows that is able to run docker (something currently not possible with Bash on Ubuntu on Windows that is running using Ubuntu 16.04 binaries).

Maybe, in the future, you'll be able to run the needed commands (found here, under Arbitrary --user Notes), but these are *nix commands and powershell (started by Kitematic) can't run those. Bash for Ubuntu for Windows could run those, but that shell has no connection to the docker daemon/service on windows...

TL;DR: Lost a day of work: It is currently impossible on Windows.

这篇关于在启用卷时,无法启动任何容器Docker Toolbox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆