I checked https://openvz.org/Docker_inside_CT
In my VPS kernel version is 2.6.32-042stab120.11
Hosting confirmed that some of they clients are using Openvz with docker installed in in. So I should be able to run Docker.
I tried to find solustion for my problem but without any success.
I can install CentOS; debian7,8; ubuntu 14,16. I tried on debian 8 and ubuntu 16.04 and I receive same problems Within the installation process I receive error:
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)
Output from docker version
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
I dont know why docker version is not getting me back server version and how I can force docker to work on this machine.
If I install docker-engine 1.9.1 I get
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)
I have been able to get docker running inside a CentOS 7 container on an OpenVZ 6 host using the documentation from their wiki, but I have not tried this with any other distributions.
If you look at the wiki, pay attention to the limitations. It would only be able to run the "vfs" storage driver so you lose a lot of the benefits of docker storage.
Make sure your container has a veth interface, not the default venet or docker won't start and will complain about bridge issues (may additionally require the bridge feature being enabled for your container).
You also need to configure docker to use the vfs storage driver, I noticed from the 1.9.1 error you posted it complained about trying to use overlay storage.
I saw another error regarding nf_nat which indicates the host is restricting netfilter in the container, netfilter needs to be set to full for your container as explained in the wiki.