Part 2: Docker CE and Docker Compose installation with ubuntu

Docker CE for Ubuntu

To install Docker CE, you need the 64-bit version of one of these Ubuntu versions:

  • Zesty 17.04
  • Xenial 16.04 (LTS) My blog on this version
  • Trusty 14.04 (LTS)
$ lsb_release -aNo LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial
$ uname -aLinux name-HP-15-Notebook-PC 4.4.0-112-generic #135-Ubuntu SMP Fri Jan 19 1:48:36 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Uninstall old versions

Older versions of Docker were called docker or docker-engine. If these are installed, uninstall them:

$ sudo apt-get remove docker docker-engine docker.io
  • Some users download the DEB package and install it manually and manage upgrades completely manually. This is useful in situations such as installing Docker on air-gapped systems with no access to the internet.
  • In testing and development environments, some users choose to use automatedconvenience scripts to install Docker.

Install using the repository

a. Update the apt package index:

$ sudo apt-get update
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"

INSTALL DOCKER CE

a. Update the apt package index.

$ sudo apt-get install docker-ce
$ sudo apt-get install docker-ce=<VERSION>
$ sudo docker run hello-world

Install Docker Compose

Docker Compose relies on Docker Engine for any meaningful work, so make sure you have Docker Engine installed either locally or remote, depending on your setup.

sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
$ docker-compose --version

Uninstallation, Upgrading and all available at
Reference :
https://docs.docker.com/compose/install/#install-compose

back to docker Series

Tech blogger..