docker-does-not-work

Ubuntu: Docker does not work (Error response from daemon: rpc error: code = 2 desc = “oci runtime error: exit status 1”)

Today Viafirma will use this post to discuss about Docker, an very interesting alternative to the virtualization of Operative Systems, In addition, we will explain you how to resolve the following error: response from daemon- rpc error- code = 2 desc = -oci runtime error- exit status 1-. Are you ready? We started.

As it was mentioned before, Docker has become a really interesting alternative to the virtualization of Operative Systems, due to the fact that it is based on displaying containers that share resources with the host systems in instead of installing a complete O.S.:

This philosophy is translated in a smaller consumption of resources, therefore is it possible to display multiple containers in the same host system, notably reducing the load that this supposes for it. Somehow, this solution is very smart, because it avoids redundancy: Why replicates several times the same resources when I can share them?

I really like the idea, let´s try it in my computer (Ubuntu 12.04).

Initially, it seems that the installation process, following the steps indicated on the website, is very simple. You only need to execute the following command:

$ curl -fsSL https://get.docker.com/ | sh

Everything is ok till here, but as it is usually happens in automated processes, when problems arise you cannot do much. Now is the time to try the installation with:

$ docker run hello-world

Suddenly you receive this wonderful message:

Error response from daemon: rpc error: code = 2 desc = "oci runtime error: exit status 1"

How can this happen? I have just followed the only step required for the installing.

If you look for solutions on the Internet, you are going to find an incredibly high numbers of different answers, it is seems that there are not much consensus on how to sort it, but in one thing: Docker does not work with kernell 3.2 or older versions. Therefore, a first step would be to double check that your Kernel is newer than that. The problem comes when you confirm that it is and it is still not working, what´s wrong here?

How to sort in Docker the error: ‘Error response from daemon- rpc error- code = 2 desc = -oci runtime error- exit status 1-‘

Even though it seems complicated, the answer is very simple: your version of OS/Kernell is not compatible with the version that you have installed. The magic command that we mentioned before to install Docker only download the latest version, however, if your OS is not the latest one, it can get you in troubles (Ubuntu 12.04. for example). How to sort it? Simple, download a older version following the next steps:

Download the key from the repository:

$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9

Settle the repository:

$ sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
$ sudo apt-get update

Look for the available versions:

$ sudo apt-cache search docker

Install the last one listed (in this case, 1.9.1):

$ sudo apt-get install lxc-docker-1.9.1

Enable the execution with your current user:

$ sudo usermod -aG docker tu_usuario

Authorise the execution :

$ docker run hello-world

If everything has been correct, now you can finally receive the message that you were waiting for since the beginning:

Hello from Docker.

This message shows that your installation appears to be working correctly.

It is very important to take into considerations that this steps has been done using Ubuntu 12.04.

We really hope that this information is useful for you and if you have any questions, please let us know.

See you next week!