1

I'm looking to use Docker compose with v2 docker-compose.yml syntax.

When I'm following the documentation (https://store.docker.com/editions/community/docker-ce-server-ubuntu?tab=description) old docker and docker-compose version has installed :

$ 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 install docker docker-compose
.../...
$ dpkg -l |grep docker
ii  docker                                      1.5-1                                        amd64        System tray for KDE3/GNOME2 docklet applications
rc  docker-ce                                   17.03.1~ce-0~ubuntu-yakkety                  amd64        Docker: the open-source application container engine
ii  docker-compose                              1.5.2-1                                      all          Punctual, lightweight development environments using Docker
ii  docker.io                                   1.12.6-0ubuntu1~16.10.1                      amd64        Linux container runtime
ii  python-docker                               1.8.0-0ubuntu1                               all          Python wrapper to access docker.io's control socket
ii  python-dockerpty                            0.4.1-1                                      all          Pseudo-tty handler for docker Python client (Python 2.x)

In order to use version 2 docker compose file format I need more recent version.

Documentation page of Docker Compose : https://github.com/docker/docker.github.io/blob/master/compose/compose-file/compose-versioning.md

Version 2 files are supported by Compose 1.6.0+ and require a Docker Engine of version 1.10.0+.

How do I get recent version of docker engine & docker compose ? I googled this many times today without fine any "simple" solution.

My system : Ubuntu 16.10

Thanks for your help, David

David
  • 755
  • 1
  • 9
  • 22
  • The Docker installation is looking good - if you want, you can switch to the newest versions by changing from `stable` to `edge` channel. But the installation (und upgrade process) of Docker Compose remains a problem with this approach. I found a much easier one - just use pip package manger and do a `pip install docker-compose` ([see so answer here](https://stackoverflow.com/a/50454860/4964553)). – jonashackt May 21 '18 at 18:46

1 Answers1

2

The easiest way to install Docker is to run:

curl -sSL https://get.docker.com/ | sh

You will probably need to run apt-get remove docker docker-compose first.

To install docker-compose, I normally grab the latest release from the docker-compose Github project e.g:

curl -L https://github.com/docker/compose/releases/download/1.12.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
Adrian Mouat
  • 44,585
  • 16
  • 110
  • 102