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