Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Ubuntu installs Docker


May 22, 2021 Docker From entry to practice


Table of contents


The Ubuntu series installs Docker

Installed with the system's own package

The Ubuntu 14.04 version system already has its own Docker package that can be installed directly.

$ sudo apt-get update
$ sudo apt-get install -y docker.io
$ sudo ln -sf /usr/bin/docker.io /usr/local/bin/docker
$ sudo sed -i '$acomplete -F _docker docker' /etc/bash_completion.d/docker.io

If you install Docker using the operating system's own package, the version currently installed is older 0.9.1. To install the updated version, you can do so by using the Docker feed.

Install the latest version from the Docker feed

To install the latest version of Docker, you first need to install apt-transport-https support, and then install it by adding a source.

$ sudo apt-get install apt-transport-https
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
$ sudo bash -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
$ sudo apt-get update
$ sudo apt-get install lxc-docker

14.04 Previous version

In the case of an earlier version of the Ubuntu system, the kernel needs to be updated first.

$ sudo apt-get update
$ sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring
$ sudo reboot

Then repeat the steps above.

Start the Docker service after installation.

$ sudo service docker start