Docker and Docker Compose Installation in Ubuntu

It's kind of annoying that when you're upgrading the Dockerfile version, your Docker Engine and Docker Compose does not support it and you've up either upgrade both the softwares. Reading through the documentation was rather frustrating as you've to jump from section to section. Or maybe I miss out something instead?

First, read and check which Docker server supports which Dockerfile version.

Next, upgrade your Docker Engine. This will work for either new or existing installation.
$ sudo apt-get remove docker docker-engine docker.io
$ sudo apt-get update

$ sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual \
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"

$ sudo apt-get update
$ sudo apt-get install docker-ce

Next, check your Docker client and server version.
$ docker version
Client:
 Version:      17.06.0-ce
 API version:  1.30
 Go version:   go1.8.3
 Git commit:   02c1d87
 Built:        Fri Jun 23 21:18:10 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.06.0-ce
 API version:  1.30 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   02c1d87
 Built:        Fri Jun 23 21:17:03 2017
 OS/Arch:      linux/amd64
 Experimental: false

For Docker Compose, just install or upgrade the software through Python package manager, pip.
$ sudo -H pip install docker_compose --upgrade

Check the installed version just to verify it.
$ docker-compose version
docker-compose version 1.14.0, build c7bdf9e
docker-py version: 2.3.0
CPython version: 2.7.13
OpenSSL version: OpenSSL 1.0.1t  3 May 2016

No comments:

Post a Comment