0

Docker version: docker --version Docker version 20.10.6, build 370c289

Docker compose version: docker-compose -v docker-compose version 1.29.2, build 5becea4c

My docker-compose.yaml file

version: '3'
sevices:
  jenkins:
    container_name: jenkins
    image: docker.io/jenkins 
    ports:
      - "8080:8080"
    volumes:
      - "/home/jenkins/jenkins-data/jenkins_home:/var/jenkins_home"
    network:
      - net
networks:
  net:

Error:

[jenkins@jenkins jenkins-data]$ docker-compose up -d
ERROR: The Compose file './docker-compose.yaml' is invalid because:
'sevices' does not match any of the regexes: '^x-'

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.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/
[jenkins@jenkins jenkins-data]$ 

Have already tried by changing version in docker-compose.yaml file to 3.1, 3.2, 1.29

1 Answer 1

4

You are missing the r in services on line 2

Sign up to request clarification or add additional context in comments.

2 Comments

Can't image this was the reason. :( Also, I want to know one thing when my docker-compose version is 1.29.2 why we use version as '3' in yaml file. I am following a tutorial to get started with and it is not explain there.
3 is the docker-compose file format. 1.29.2 is the docker-compose version. There is some slightly different syntax between docker-compose file format versions

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.