Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run docker in ubuntu live disk

I was wondering if it's possible to install and run Docker in a Ubuntu 14.04 USB Live-Disk.

I'm trying it with a 8GB USB, 4 GB for installation and 4 GB for persisted storage, but I keep getting errors when running the containers (no problem in pulling them).

Here is my Docker version:

$ sudo docker version Client version: 1.6.2 Client API version: 1.18 Go version (client): go1.4.2 Git commit (client): 7c8fca2 OS/Arch (client): linux/amd64 Server version: 1.6.2 Server API version: 1.18 Go version (server): go1.4.2 Git commit (server): 7c8fca2 OS/Arch (server): linux/amd64 

And the current error I'm getting when running a docker container is:

[8] System error: mountpoint for cpu not found  

OBS: Sometimes the error is that the cpuset or that the devices were not found.

The kernel of the live-disk that I'm using is:

$ uname -r 3.13.0-32-generic 

If the Ubuntu live disk is not the best live-disk to run Docker, are there any other alternatives that have some GUI with it, not just a simple terminal to run docker?

I'm saying this because I'm trying to introduce Docker to my parents, but they don't want to install a linux in their PCs, and so I need some simple graphic interface to write down the Dockerfile, open a browser, etc...


UPDATE

I saw that during the install there was a error when setting up the cgroup-lite dependency initctl: Unknown job: cgroup-lite. Also I read that some ubuntu need to install apparmor so that the docker installation works properly.

So I installed it and reinstalled docker (cgroup-lite installed with no problem then), and now I'm getting this when running the sudo docker -d

INFO[0000] +job serveapi(unix:///var/run/docker.sock)    INFO[0000] Listening for HTTP on unix (/var/run/docker.sock)  INFO[0000] +job init_networkdriver()                     INFO[0000] -job init_networkdriver() = OK (0)            WARN[0004] Your kernel does not support cgroup swap limit.  INFO[0004] Loading containers: start.                    ...... INFO[0004] Loading containers: done.                     INFO[0004] docker daemon: 1.6.2 7c8fca2; execdriver: native-0.2; graphdriver: aufs  INFO[0004] +job acceptconnections()                      INFO[0004] -job acceptconnections() = OK (0)             INFO[0004] Daemon has completed initialization  

And when trying to run a container I receive>

ERRO[0125] HTTP Error: statusCode=500 Cannot start container 90875e79dec37cec41a67aac235b81f0fc17c4e011cd6e5368a4b29336587f5b:  [8] System error: permission denied 

Not sure about the kernel not supporting cgroup, but if so, then is it possible to update the kernel in the livedisk (persisting it?) ?

like image 303
Arruda Avatar asked May 14 '15 22:05

Arruda


People also ask

Can we install Docker on Ubuntu VM?

Method 1: Install Docker From apt Repository Follow the instructions given below to install docker from the apt repository. Step 1: Update the apt cache. Step 2: Add the GPG key. Step 3: Add the docker apt repository.

Can Docker be installed on bare metal?

Docker is more limited and can run only on Linux, certain Windows servers and IBM mainframes if hosted on bare metal. For example, Docker runs natively only on bare-metal Windows servers running Windows Server 2016 or later.


2 Answers

I've managed to make this work by changing the Docker storage to devicemapper instead of AUFS.

If your system doesn't use Systemd

You just have to change /etc/default/docker to have this in it:

DOCKER_OPTS="--storage-driver=devicemapper" 

If your system uses Systemd

See this answer and add --storage-driver=devicemapper at the end of the docker start command.

I've manage to make the containers run ok with this, but I prefer using AUFS.

I realized that the partition was not using aufs by default, but something like caw or cow (can't remember now).

I also tried to make it work using AUFS using the union=aufs flag in grub, but when running the docker daemon I get a FATA[0000] Shutting down daemon due to errors: error intializing graphdriver: backing file system is unsupported for this graph driver, that looks related to https://github.com/docker/docker/issues/7321

I'll leave my answer here, since it is a workaround for this problem, but if anyone manage to make this work using AUFS it would be, in my opinion, a better answer.

like image 145
Arruda Avatar answered Oct 12 '22 11:10

Arruda


You want to tell the Docker daemon to store the data related to your containers on the persistent storage.

By default the docker daemon put those data into /var/lib/docker. You can change that location with the --graph docker daemon option

like image 33
Thomasleveil Avatar answered Oct 12 '22 10:10

Thomasleveil