Lxd: Error running docker inside an lxd container, works fine outside of container

Created on 11 Apr 2017  路  8Comments  路  Source: lxc/lxd

Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial
Kernel: 4.4.0-71-generic

docker version
Client:
Version: 17.03.1-ce
API version: 1.27
Go version: go1.7.5
Git commit: c6d412e
Built: Mon Mar 27 17:14:09 2017
OS/Arch: linux/amd64

Server:
Version: 17.03.1-ce
API version: 1.27 (minimum version 1.12)
Go version: go1.7.5
Git commit: c6d412e
Built: Mon Mar 27 17:14:09 2017
OS/Arch: linux/amd64
Experimental: false

Fresh server, only ubuntu OS , lxd, and docker installed. I followed the installation instructions for docker from their docs page for the CE version: docs.docker.com/engine/installation/linux/ubuntu/#install-using-the-repository

Running the "Hello-World" app inside the container as root user (sudo user same thing) gives the following error:

docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "process_linux.go:252: getting pipe fds for pid 2391 caused "readlink /proc/2391/fd/0: permission denied"".

Note: I am using ZFS storage (with proper packages to enable ZFS on linux) for the LXD container, however I have not made any modifications to the docker installation -- just the defaults it installed with.

Most helpful comment

Docket upstream is still missing a patch required to work out of the box in a LXD container. Until it is merged we recommend to use the Ubuntu Docker package.

All 8 comments

Docket upstream is still missing a patch required to work out of the box in a LXD container. Until it is merged we recommend to use the Ubuntu Docker package.

@brauner Do you mean apt-get install docker.io inside the container ? (for 14.04)

This recommendation no longer applies that was from back in April, the change in question is now part of the normal Docker deb packages.

@stgraber but i have exactly the same problem as first post here in ubuntu 14.04 yet!

should i open a new issue ?

@hooramin, wait, are you saying that you are on Ubuntu 14.04 if so what is the Docker version you are using. Afaik, the minimal required version for Docker to work out of the box in LXD is 17.06 . (I'm not sure about their current numbering scheme though.) If you install that version you should be fine. The installation instruction can be found in the Docker documentation.

@brauner I'm on ubuntu 16.04 and my container is ubuntu 14.04

root@container:~#  docker-compose --version
docker-compose version: 1.4.2
root@container:~# docker --version
Docker version 1.6.2, build 7c8fca2

I followed their document instructions and i got error , also i tried to do as lxd docker document
in both of them i got a same error as first post

root@container:~#  docker run hello-world
FATA[0000] Error response from daemon: Cannot start container ad0ea7fd6ffc14f4c6d48b30f70a13a38542e39f042c9e1fa256bd16852d6d51: [8] System error: write /sys/fs/cgroup/devices/docker/ad0ea7fd6ffc14f4c6d48b30f70a13a38542e39f042c9e1fa256bd16852d6d51/devices.allow: operation not permitted

Right, you're running a Docker version that's super old and that will not work inside LXD.

The instructions that said that docker.io from Ubuntu would work inside LXD were for Ubuntu 16.04, not 14.04. You either need Ubuntu's version of Docker at version 1.12 or higher, or the upstream Docker build which should be version 17.06 or higher.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rrva picture rrva  路  5Comments

srkunze picture srkunze  路  3Comments

mlaradji picture mlaradji  路  4Comments

kp3nguinz picture kp3nguinz  路  5Comments

sajoupa picture sajoupa  路  4Comments