docker icon indicating copy to clipboard operation
docker copied to clipboard

Support newer version of docker-compose

Open zbyte64 opened this issue 9 years ago • 13 comments

Currently only docker-compose 1.5.0 or older will work with the installed version of docker. This means version 2 of the docker-compose.yml format is incompatible with circle ci.

zbyte64 avatar Apr 07 '16 03:04 zbyte64

Any updates to this? version 2 compose files contain features which I need for my project to run and I would imagine more and more version 2 files will come while version 1 files are slowly being phased out.

vegasbrianc avatar Jul 07 '16 11:07 vegasbrianc

i also agree. need version 2 to specify image name in the build (unless someone knows how to specifically define image name in version 1 compose files that would be of great help).

adrielldagasuan avatar Jul 28 '16 16:07 adrielldagasuan

I found a solution thanks to @adrien-dong 👍 . In your circle.yml :

machine:
  pre:
   - curl -sSL https://s3.amazonaws.com/circle-downloads/install-circleci-docker.sh | bash -s -- 1.10.0
   - sudo pip install docker-compose

The versions should be :

  • docker 1.10.0-circleci
  • docker-compose 1.8

ygotthilf avatar Aug 10 '16 13:08 ygotthilf

Hi @ygotthilf Are you using version 2 compose files? I tried your suggestion but now it is not compatible with the engine version which is keeps failing to upgrade

vegasbrianc avatar Aug 10 '16 14:08 vegasbrianc

Great stuff @ygotthilf but unfortunately caching docker layers does not work with 1.10...

Issue: https://github.com/docker/docker/issues/20380 https://circleci.com/docs/docker/#caching-docker-layers

deepflame avatar Oct 24 '16 09:10 deepflame

I applied @ygotthilf 's workaround and it worked for a while, but then all of a sudden it doesn't work. Has anyone bump into this problem again?

All of a sudden the workaround doesn't update docker compose:

docker-compose version
docker-compose version 1.5.2, build 7240ff3
docker-py version: 1.5.0
CPython version: 2.7.9
OpenSSL version: OpenSSL 1.0.1e 11 Feb 2013

portenez avatar Jan 18 '17 17:01 portenez

I just fixed this in our app this morning.

Replace sudo pip install docker-compose with:

    - curl -L https://github.com/docker/compose/releases/download/1.10.0/docker-compose-`uname -s`-`uname -m` > /home/ubuntu/bin/docker-compose
    - chmod +x /home/ubuntu/bin/docker-compose
    - docker-compose version

I went with /home/ubuntu/bin as it's earlier in the PATH than /usr/local/bin which even root doesn't have access to.

ryansch avatar Jan 18 '17 17:01 ryansch

Thanks @ryansch, we just started seeing that error here too, and your suggestion fixed it for us.

iamdave92 avatar Jan 18 '17 21:01 iamdave92

FYI if you ran into docker-compose.yml version issue in the past day or so.

https://discuss.circleci.com/t/docker-compose-version-change/9685

kevunix avatar Jan 18 '17 22:01 kevunix

I went with this:

    - curl -L https://github.com/docker/compose/releases/download/1.10.0/docker-compose-`uname -s`-`uname -m` > /home/ubuntu/bin/docker-compose
    - chmod +x /home/ubuntu/bin/docker-compose
    - docker-compose version

Then when I try to run docker-compose up -d some-service in Circle, this error appears

ERROR: The Docker Engine version is less than the minimum required by Compose. Your
current project requires a Docker Engine of version 1.10.0 or greater.

yookoala avatar Feb 23 '17 13:02 yookoala

for those reaching here in 2021, the easier way to install compose is adding the following two lines after the first line (version 2.1):

orbs:
    docker: circelci/[email protected]

Then on each job, there should be a step with just (without run):

  - docker/install-docker-compose

CrimsonGlory avatar Sep 21 '21 21:09 CrimsonGlory

for those reaching here in 2021, the easier way to install compose is adding the following two lines after the first line (version 2.1):

orbs:
    docker: circelci/[email protected]

Then on each job, there should be a step with just (without run):

  - docker/install-docker-compose

This not working for me..

This error appears:

Latest stable version of docker-compose is v2.0.1
A different version of docker-compose is installed (docker-compose version 1.25.4, build xxxxx); removing it

camilojimenezf avatar Oct 01 '21 14:10 camilojimenezf

This not working for me..

check this: https://github.com/CircleCI-Public/docker-orb/issues/94#issuecomment-930515200

CrimsonGlory avatar Oct 01 '21 14:10 CrimsonGlory