2

There are no official Docker package for Debian jessie. There's a backport, and I have installed it, but when started, it was emitting errors for crucial tasks like running a container.

There's a proposed solution on the internet that says (regarding Debian docker installation): add deb https://get.docker.com/ubuntu docker main to the sources.list then:

sudo apt-get update
sudo apt-get install lxc-docker

It seems (I have read it in a comment) Docker guarantees that their package is running both on Ubuntu and Debian.

Indeed, this installation performed well on my Ubuntu 14.04 laptop, and docker is running containers just fine.

However, when trying the same thing on the server with Debian jessie I just can't install docker:

myuser@srv:~$ sudo apt-get install lxc-docker
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package lxc-docker

I also tried with the package name docker.io, which is the name of the obsolete docker package:

myuser@srv:~$ sudo apt-get install docker.io
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package docker.io is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'docker.io' has no installation candidate

Any idea what could be wrong ?


Here's the docker.list file I put in /etc/apt/sources.list.d:

deb https://get.docker.com/ubuntu docker main

The permissions seem normal:

$ ls -l /etc/apt/sources.list.d/docker.list
-rw-r--r-- 1 root root  46 Sep 20 17:26 docker.list


As suggested I installed ( again ) the docker.io backport package and it gave me the errors:

Impossible to start a container:

myuser@srv:/etc/apt/sources.list.d$ sudo docker run --rm hello-world
FATA[0000] Post http:///var/run/docker.sock/v1.18/containers/create: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS? 

But worse, now it's impossible to sudo apt-get remove the docker.io backport package:

Removing docker.io (1.6.2~dfsg1-1~bpo8+1) ...
[....] Stopping Docker: dockerstart-stop-daemon: warning: failed to kill 23321: No such process
1 pids were not killed
No process in pidfile '/var/run/docker-ssd.pid' found running; none killed.
invoke-rc.d: initscript docker, action "stop" failed.
dpkg: error processing package docker.io (--remove):
 subprocess installed pre-removal script returned error exit status 1
dpkg: error while cleaning up:
 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)

and the package is never removed. That was the reason I reinstalled debian yesterday, and chose to give a chance to the docker oriented solution using deb https://get.docker.com/ubuntu docker main

This is maybe related to this issue: docker can't be uninstalled if it never worked


Thanks to the link, above, the culprit that forbids removing the docker.io package is in the pre-remove script:

/var/lib/dpkg/info/docker.io.prerm

I have modified it, commenting the 3 lines that tries to do the docker stop like this:

# Automatically added by dh_installinit
#if [ -x "/etc/init.d/docker" ] && [ "$1" = remove ]; then
#   invoke-rc.d docker stop || exit $?
#fi

And the package got removed nicely. (I have been really a barbarian reinstalling debian because of this yesterday...)

closed as off-topic by Gilles, Anthon, muru, cuonglm, Archemar Sep 21 '15 at 6:47

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Gilles, Anthon, muru, cuonglm, Archemar
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Was the docker repo shown in the output of apt-get update? Perhaps the file in /etc/apt/sources.list.d is being ignored. What permissions does it have? – terdon Sep 20 '15 at 13:53
  • for the permissions: -rw-r--r-- 1 root root 46 Sep 20 13:19 docker.list – Stephane Rolland Sep 20 '15 at 14:24
  • And does it appear in the output of apt-get update? Check sudo apt-get update 2>&1 | grep docker. You might want to try the Unix & Linux Chat for more help debugging this. – terdon Sep 20 '15 at 14:28
  • 1
    perror says that anyway I could NOT run docker in a chrooted environement, which is the case... So I give up for the moment. – Stephane Rolland Sep 20 '15 at 14:33
2

I am pretty sure that Debian jessie has a docker.io package, but you must enable the jessie-backports.

To enable jessie-backports, just add the following line in your /etc/apt/sources.list:

deb http://http.debian.net/debian jessie-backports main

Then, update your package base:

$> sudo apt-get update

Now, you should be able to install the docker.io package:

$> sudo apt-get install docker.io

Once this is done, you can check that everything is fine with:

$> sudo docker run --rm hello-world

You can find a summary of what I explained here on this page.

  • that lead me to the same problem why I reinstalled debian yesterday, and chose to use the docker.com oriented solution. I have update the question accordingly. – Stephane Rolland Sep 20 '15 at 10:57
  • Have you a 64bits distribution ? Or, a 32bits one ? – perror Sep 20 '15 at 11:29
  • I have checked to be sure with uname -a , and I got ` x86_64` – Stephane Rolland Sep 20 '15 at 11:47
  • And, are you sure that you did run the apt-get update after modifying the /etc/apt/sources.list? (sorry but it seems to me that if you follow the steps that I listed in the answer you should have access to the package). – perror Sep 20 '15 at 12:27
  • 2
    I think I better understand the problem now ! In fact, as you already suspected it, you cannot run Docker inside a chroot (it is due to conflicts with the container techniques that are used). You'd better to try Docker directly on your environment. – perror Sep 20 '15 at 13:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.