首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >OpenVZ VPS中的Docker

OpenVZ VPS中的Docker
EN

Stack Overflow用户
提问于 2017-07-22 20:51:21
回答 1查看 3K关注 0票数 0

我查了https://openvz.org/Docker_inside_CT

在我的VPS内核版本是2.6.32-042STABL120.11

托管确认其中一些客户端正在使用Openvz,并在中安装了docker。所以我应该可以运行Docker了。

我试图为我的问题找到解决办法,但没有成功。

我可以安装CentOS;debian7,8;ubuntu14,16。我在debian8和ubuntu16.04上尝试过,在安装过程中我收到了同样的问题,我收到了错误:

代码语言:javascript
复制
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
invoke-rc.d: initscript docker, action "start" failed.
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2017-07-22 08:01:57 EDT; 38ms ago
     Docs: https://docs.docker.com
  Process: 22638 ExecStart=/usr/bin/docker daemon -H fd:// $DOCKER_OPTS (code=exited, status=1/FAILURE)
 Main PID: 22638 (code=exited, status=1/FAILURE)

Jul 22 08:01:57 xyz systemd[1]: Starting Docker Application Container Engine...
Jul 22 08:01:57 xyz docker[22638]: time="2017-07-22T08:01:57.543399289-04:00" level=fatal msg="Your Linux kernel version 2.6.32-042stab120.11 is unstable running Docker. Please upgrade your kernel to 3.10+."
Jul 22 08:01:57 xyz systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Jul 22 08:01:57 xyz systemd[1]: Failed to start Docker Application Container Engine.
Jul 22 08:01:57 xyz systemd[1]: docker.service: Unit entered failed state.
Jul 22 08:01:57 xyz systemd[1]: docker.service: Failed with result 'exit-code'.
dpkg: error processing package docker.io (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 docker.io
E: Sub-process /usr/bin/dpkg returned an error code (1)

docker版本的输出

代码语言:javascript
复制
Client:
 Version:      1.10.3
 API version:  1.22
 Go version:   go1.6.1
 Git commit:   20f81dd
 Built:        Wed, 20 Apr 2016 14:19:16 -0700
 OS/Arch:      linux/amd64
An error occurred trying to connect: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.22/version: read unix @->/var/run/docker.sock: read: connection reset by peer

我不知道为什么docker版本不能让我恢复服务器版本,以及我如何才能强制docker在这台机器上工作。

如果我安装docker-engine 1.9.1,我会得到

代码语言:javascript
复制
Jul 22 11:09:32 xyz docker[32115]: time="2017-07-22T11:09:32.413474210-04:00" level=warning msg="Your Linux kernel version 2.6.32-042stab120.11 can be unstable running docker. Please upgrade your kernel to 3.10.0."
Jul 22 11:09:32 xyz docker[32115]: time="2017-07-22T11:09:32.417040756-04:00" level=error msg="'overlay' not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlay support loaded."
Jul 22 11:09:32 xyz docker[32115]: time="2017-07-22T11:09:32.420093045-04:00" level=warning msg="Running modprobe bridge br_netfilter failed with message: modprobe: ERROR: ../libkmod/libkmod.c:514 lookup_builtin_fil...be: WARNING: Modul
Jul 22 11:09:32 xyz docker[32115]: time="2017-07-22T11:09:32.421785030-04:00" level=warning msg="Running modprobe nf_nat failed with message: `modprobe: ERROR: ../libkmod/libkmod.c:514 lookup_builtin_file() could not open builtin fil...
Jul 22 11:09:32 xyz docker[32115]: time="2017-07-22T11:09:32.446647894-04:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address"
Jul 22 11:09:32 xyz docker[32115]: time="2017-07-22T11:09:32.457352813-04:00" level=fatal msg="Error starting daemon: Error initializing network controller: Error creating default \"bridge\" network: package not installed"
Jul 22 11:09:32 xyz systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Jul 22 11:09:32 xyz systemd[1]: Failed to start Docker Application Container Engine.
Jul 22 11:09:32 xyz systemd[1]: docker.service: Unit entered failed state.
Jul 22 11:09:32 xyz systemd[1]: docker.service: Failed with result 'exit-code'.
Hint: Some lines were ellipsized, use -l to show in full.
dpkg: error processing package docker-engine (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Processing triggers for systemd (229-4ubuntu19) ...
Errors were encountered while processing:
 docker-engine
E: Sub-process /usr/bin/dpkg returned an error code (1)
EN

回答 1

Stack Overflow用户

发布于 2017-08-02 16:53:57

我已经能够使用wiki中的文档在OpenVZ 6主机上的CentOS 7容器中运行docker,但我还没有在任何其他发行版中尝试过这一点。

如果您查看wiki,请注意其局限性。它将只能运行"vfs" storage driver,因此您将失去许多docker存储的好处。

确保您的容器有一个veth接口,而不是默认的venet或docker无法启动,并会抱怨桥接问题(可能还需要为您的容器启用桥接功能)。

您还需要配置docker来使用vfs存储驱动程序,我从您发布的1.9.1错误中注意到,它抱怨尝试使用覆盖存储。

我看到了另一个关于nf_nat的错误,它表明主机正在限制容器中的netfilter,需要将容器的netfilter设置为full,如维基中所述。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45254768

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档