gpt4 book ai didi

docker - CircleCI './docker-compose.yml'服务 'version'没有任何配置选项

转载 作者:行者123 更新时间:2023-12-02 18:44:31 25 4
gpt4 key购买 nike

相关,但不重复:Docker - docker-compose 'version' doesn't have any configuration options

我目前正在使用带有以下docker-compose.yml v2 circle.yml:

machine:
services:
- docker

test:
post:
- docker build --rm=false -t zurfyx/repo:$CIRCLE_SHA1 .
- docker-compose run web npm test

deployment:
hub:
branch: master
commands:
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- docker push zurfyx/repo:$CIRCLE_SHA1

CircleCI提供以下输出:
docker-compose run web npm test
ERROR: In file './docker-compose.yml' service 'version' doesn't have any configuration options. All top level keys in your docker-compose.yml must map to a dictionary of configuration options.

docker-compose run web npm test returned exit code 1

我尝试了在最近的CircleCI论坛帖子中显示的 following solutions,但没有设法解决这个问题。

最佳答案

需要将 docker和docker-compose的升级到最新版本:

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

services:
- docker

为什么两者同时使用?

有人说使用pip将docker-compose升级到最新版本就足够了,但显然还不够(因为当前的Docker Engine CircleCI版本不再支持,至少现在不再支持):

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.



如果仅升级Docker引擎,则没有任何区别,因为解析v2 YAML文档需要更高的docker-compose版本。

关于docker - CircleCI './docker-compose.yml'服务 'version'没有任何配置选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42014072/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com