Installing Docker on Ubuntu 14.04
Category : How-to
Docker is an up and coming virtualisation technology utilising Linux Containers (LXC) to provide a private and consistent working environment across all Docker installations. Docker aims to create portable templates which can be created and distributed to run on any Docker enabled host.
Docker works on a similar premise to OpenVZ and is therefore limited by the same constraints, such as only Linux guests can be created in Docker as each guest shares the hosts kernel. Installing Docker on Ubuntu couldn’t be easier since version 14.04 of Ubuntu saw the Docker packages available through the standard Ubuntu repositories.
Install Docker using the apt-get command:
$ apt-get install docker.io
Check that the docker daemon has been started with the status argument, or start it with the start argument:
$ service docker.io status $ service docker.io start
Create a symlink to the Docker executable so that the Docker documentation commands can be executed without changing the path. This is required because the Ubuntu package for Docker is installed to a different directory to the default Docker recommendation.
$ ln -sf /usr/bin/docker.io /usr/local/bin/docker
And that’s all there is to it! You now have a working Docker environment. See my next blog post for Creating your first Docker container.
6 Comments
Shannon Mann
18-Jun-2014 at 7:28 pmI’ve been working with Docker for a couple of weeks now. We ran one of the images from the repository (sameersbn/gitlab) and ran into problems.
Apparently the version in the Ubuntu 14.04 repositories has some issue with running ‘sudo -u git -H’ preventing it from working.
Installing Docker from get.docker.io resolves the problems:
apt-key adv –keyserver hkp://keyserver.ubuntu.com:80 –recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
sh -c “echo deb https://get.docker.io/ubuntu docker main \
> /etc/apt/sources.list.d/docker.list”
apt-get update
apt-get install lxc-docker
If you’ve installed docker.io first, you’ll want to remove that install.
We’ve been happy with Docker, but I’d suggest learning to build from Dockerfile. ‘sameersbn/gitlab’ is 18GB when pulled, and 1.1 GB when built. Apparently some of the images from Docker are quite large.
james.coyle
19-Jun-2014 at 11:51 amI have not encountered that issue, but thanks for raising it.
I agree with the Dockerfile – I have a blog post in draft that should be out shortly.
sameersbn
19-Jul-2014 at 4:00 pmYou should provide the specific version of the image you want to pull, else docker will pull all available versions of the repo.
ramzi debab
16-Sep-2014 at 4:21 pmHi,
I have a question please concerning the additional kernel modules needed in a given container for example. Let us say that the host is based on a linux distribution kernel (CoreOS for example). I create a container based on an other linux distribution (Fedora for example) running an application needing a custom kernel module M1. How this module will be executed? It will be integrated into the original host kernel (CoreOS) or it will be integrated into another layer ? Any additional links explaining deep docker internals will be welcome.
Regards.
Ramzi.
J Bruni
30-Jan-2015 at 11:43 pmAt Lubuntu 14.04, I just had to “apt-get install docker.io” and that was all.
The service was running, but named “docker” (not docker.io)
And the command-line utility was available (again, as “docker”).
Couldn’t be easier.
Kev1
19-Mar-2018 at 10:26 amSame observation on Ubuntu Mate 16.04.
Thanks for article.