Welcome to the Linux Foundation Forum!

Lab4 : docker / docker-compose version requirement for Jenkins setup with docker-deployment.yaml

Hi,

I am trying to follow Lab 4 based on files provided under repo https://github.com/lfs261/devops-repo/tree/master/setup

When running 1st docker-compose command to build image ("docker-compose build"), i am getting this error :

ERROR: Version in "./docker-compose.yaml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the services key, or omit the version key and place your service definitions at the root of the file to use version 1.

Any idea what needs to be aligned or corrected to get this running ?
Versions used for docker and docker-compose :

  • Docker version 20.10.12, build e91ed57
  • docker-compose version 1.17.1, build unknown

Thank you

Answers

  • Can you try upgrading the version of Docker Compose which seems to be older. The code uses docker compose spec 3.8 which is fairly recent. For reference current version of docker compose software is 1.29.2 while what you have is 1.17.1.

    Find instructions to install compose here https://docs.docker.com/compose/install/

  • Thank you. Indeed working fine after updating docker-compose to version 1.29.2

  • Great ! thanks for confirming.

Categories

Upcoming Training