简体   繁体   中英

I can't run docker daemon on ubuntu 14.04 LTS (on VPS)

I can't run docker daemon on ubuntu 14.04 LTS (on VPS server).

root@xxx:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04 LTS
Release:    14.04
Codename:   trusty

Running daemon:

 root@xxx:~# sudo docker -d &
    [1] 16324
    root@xxx:~# 2015/02/17 13:45:35 WARNING: You are running linux kernel version 2.6.32-042stab093.4, which might be unstable running docker. Please upgrade your kernel to 3.8.0.
    2015/02/17 13:45:35 docker daemon: 1.0.1 990021a; execdriver: native; graphdriver:
    [237d5abc] +job serveapi(unix:///var/run/docker.sock)
    [237d5abc] +job initserver()
    [237d5abc.initserver()] Creating server
    2015/02/17 13:45:35 Listening for HTTP on unix (/var/run/docker.sock)
    [237d5abc] +job init_networkdriver()
    [237d5abc.init_networkdriver()] creating new bridge for docker0
    package not installed
    [237d5abc] -job init_networkdriver() = ERR (1)
    package not installed
    [237d5abc] -job initserver() = ERR (1)
    2015/02/17 13:45:35 package not installed

I tried to run hello-world application but I got this:

root@xxx:~# sudo docker run -i -t ubuntu /bin/bash
2015/02/17 13:47:25 Cannot connect to the Docker daemon. Is 'docker -d' running on this host?

Any idea how to fix it?

It depends which virtualization technology your VPS provider is using. If they are using OpenVZ for example, you can't run docker on your machine as a container can't run inside a container (unless some prerequisites are met).

Docker in OpenVZ: https://openvz.org/Docker_inside_CT Also a good post on the subject: http://slopjong.de/2014/09/03/install-docker-on-a-debian-based-vps/

First, if you are running kernel 2.6.32, you are not actually using Ubuntu 14.04, which should be running at least kernel 3.13.something. It is possible that Docker simply won't work correctly with a kernel as old as what you're using.

That said, it looks like you're getting errors when Docker is trying to manipulate bridge interfaces on your host:

[237d5abc.init_networkdriver()] creating new bridge for docker0 
package not installed

It is possible you are missing the bridge-utils package, which provides the brctl command. Try running:

apt-get install bridge-utils

And then try restarting Docker and see what happens.

I encountered the same problem with an OpenVZ VPS on Ramnode. Same "package not installed" error. The short answer is that you can't.

In my case, the Ramnode host (perhaps your host as well) isn't running an OpenVZ-enabled kernel with patches at 042stab105.4 or later, with veth, bridge, and iptables enabled in containers. My host was running 2.6.32-042stab104.1. If you're in a similar position, I'd recommend switching to a KVM-based VPS.

(I would vote-up or comment on Celine's answer but I don't have enough rep-points.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM