Docker compose文件版本兼容性错误
我有版本为20.10.5的docker引擎Docker compose文件版本兼容性错误,docker,ubuntu,docker-compose,Docker,Ubuntu,Docker Compose,我有版本为20.10.5的docker引擎 Docker version 20.10.5, build 55c4c88 和docker compose版本1.23.2 docker-compose version 1.23.2, build 1110ad01 在ubuntu版本20.04上 Linux ed 5.4.0-66-generic #74-Ubuntu SMP Wed Jan 27 22:54:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Docker version 20.10.5, build 55c4c88
和docker compose版本1.23.2
docker-compose version 1.23.2, build 1110ad01
在ubuntu版本20.04上
Linux ed 5.4.0-66-generic #74-Ubuntu SMP Wed Jan 27 22:54:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
当我尝试在版本为3.8的文件上使用docker compose命令时,它会给出错误
ERROR: Version in "./jenkins.docker-compose.yml" 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.
如果我改为3.7版,它就可以工作了。Docker文档提到3.8版应与Docker engine 19.03.0一起使用+
version: '3.8'
services:
jenkins:
build: .
image: jenkins:lts
container_name: jenkins
privileged: true
restart: always
ports:
- "50000:50000"
- "8080:8080"
networks:
- ed
volumes:
- jenkins-log:/var/log/jenkins
- jenkins-data:/var/jenkins_home
- /var/run/docker.sock:/var/run/docker.sock
- ./downloads:/var/jenkins_home/downloads
- /usr/bin/docker:/usr/bin/docker
environment:
- VIRTUAL_HOST=jenkins.ed.tech
- VIRTUAL_PORT=8080
#- SSH_AUTH_SOCK=/ssh-agent
volumes:
jenkins-data:
jenkins-log:
networks:
default:
external:
name: ed
我缺少什么?您的
docker compose版本不支持compose 3.8版。您需要更新到至少docker compose
1.25.5版:谢谢。我无法在官方兼容性文档中看到。我认为这些信息应该成为网站文档的一部分