56

I am trying to run the latest stable version of docker and docker-compose.

I am following the instructions on https://docs.docker.com/engine/installation/linux/ubuntulinux/

Apparently the current version of docker-compose is 1.7.

Yet, after running through the documentation, installing docker-engine, I then get:

$ docker-compose --version
docker-compose version: 1.4.0

And

$ docker --version
Docker version 1.11.1, build 5604cbe

When I try to update it, I get the following:

$ sudo apt-get upgrade docker-engine
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... docker-engine is already the newest version.
Done

Update

This just keeps getting stranger. After trying all of the advice below, I now get this:

$ docker-compose -v
The program 'docker-compose' is currently not installed. You can install it by typing:
sudo apt-get install docker-compose
anton@Charles:~$ sudo apt-get install docker-compose
Reading package lists... Done
Building dependency tree       
Reading state information... Done
docker-compose is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

How then can I update docker?

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Magick
  • 4,603
  • 22
  • 66
  • 103

5 Answers5

64

Try this, it is quite simple:

sudo apt-get update
sudo apt-get upgrade docker-ce

Results in the following

docker-ce is already the newest version.
robbpriestley
  • 3,050
  • 2
  • 24
  • 36
59

Since I lost half an hour on this, maybe it will help some people out there. What I had to do to upgrade my version is:

curl -L "https://github.com/docker/compose/releases/download/1.13.0/docker-compose-$(uname -s)-$(uname -m)" > ./docker-compose
sudo mv ./docker-compose /usr/bin/docker-compose
sudo chmod +x /usr/bin/docker-compose

Use the last version of docker compose instead of 1.13.0.

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Steve Lng C
  • 1,204
  • 1
  • 8
  • 9
  • 3
    This is upgrading `docker-compose` instruction, How about upgrade *docker version* to 18? – Benyamin Jafari Aug 15 '18 at 06:26
  • why not to download it directly to `curl -L "https://github.com/docker/compose/releases/download/1.13.0/docker-compose-$(uname -s)-$(uname -m)" > /usr/bin/docker-compose` ? – ImanolUr Nov 14 '18 at 16:35
20

Try this stuff :

sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"
sudo sh -c "echo deb http://get.docker.io/ubuntu docker main\ > /etc/apt/sources.list.d/docker.list"
sudo aptitude update
sudo aptitude install lxc-docker

If this is not working, lets do it via third party :

$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
$ sudo sh -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
Nishant Singh
  • 3,055
  • 11
  • 36
  • 74
  • Thanks, however, when I do this, I get exactly the same result. The version is always `docker -v Docker version 1.11.1, build 5604cbe ` – Magick Apr 29 '16 at 09:47
  • did u removed all docket stuff first ? `sudo apt-get remove docker*` Follow this maybe http://linoxide.com/linux-how-to/install-upgrade-docker-1-7/ – Nishant Singh Apr 29 '16 at 09:52
  • 1
    Yes, and now are reinstalling docker-engine, the compose version has gone down! `$ docker-compose -v docker-compose version: 1.3.1` – Magick Apr 29 '16 at 10:00
  • did you tried the official docs? coz this is weird : https://docs.docker.com/engine/installation/linux/ubuntulinux/ – Nishant Singh Apr 29 '16 at 10:12
  • Thanks Nishant. This brings docker to 1.9.1, and I have installed compose using https://docs.docker.com/compose/install/. Thanks again. – Magick Apr 29 '16 at 10:24
  • Doesn't work, my docker version was 1.9.1 now is the same version, I want to upgrade to the version 18. – Benyamin Jafari Aug 15 '18 at 06:21
  • It did not work for me. Instead, it uninstalled my docker and docker.io packages and replaced docker with an older version (docker-compose remained the same version). I had to install them again. Reported for Ubuntu 16.04. – Artur Barseghyan Apr 04 '19 at 11:51
2

What you now have to do is to update docker-composer because your docker is up to date.

https://docs.docker.com/compose/install/

curl -L https://github.com/docker/compose/releases/download/1.7.0/docker-compose-`uname -s'-'uname -m' > /usr/local/bin/docker-compose

chmod +x /usr/local/bin/docker-compose

new
  • 114
  • 3
  • When I try this I get `$ curl -L https://github.com/docker/compose/releases/download/1.7.0/docker-compose-uname -s-uname -m > /usr/local/bin/docker-compose curl: option -s-uname: is unknown` – Magick Apr 29 '16 at 09:55
  • I forgot the quotes Just follow it on the official site...https://docs.docker.com/compose/install/ curl -L https://github.com/docker/compose/releases/download/1.7.0/docker-compose 'uname -s'-'uname -m' > /usr/local/bin/docker-compose – new Apr 29 '16 at 09:59
  • Now I get `curl: option -m: requires parameter` – Magick Apr 29 '16 at 10:03
  • Ok you are not so into console just install it with binaries https://dl.bintray.com/docker-compose/master/ – new Apr 29 '16 at 10:05
  • Please read the original post. I am using Ubuntu, and have been trying to follow official documentation. – Magick Apr 29 '16 at 10:21
0
This is a problem when you have docker installed as latest version and docker-compose is old version 
try docker-compose -V  if it gives old version then  you have to uninstall via     `Pip` 

`pip uninstall docker-compose` most of the time you uninstall with the same tool how you installed old version

it might give some error and partial uninstall 
Just restart ubuntu and then install docker from 
https://docs.docker.com/engine/installation/

check docker compose  version again hopefully its latest and compatible with docker 
See the install docs for more install options and instructions.

Compose file format compatibility matrix

Compose file format Docker Engine
3.0 ; 3.1   1.13.0+
2.1         1.12.0+
2.0         1.10.0+
1.0         1.9.1+
Changes
Jin Thakur
  • 2,711
  • 18
  • 15