首页 > 解决方案 > 撰写文件必须是相同的版本 | ECS 命令行 | 码头工人撰写

问题描述

我是 ECS CLI 和 Docker 的新手。

目前,我想通过 CLI 将 dotnet 应用程序部署到 ECS。我知道 ECS CLI 仅支持 docker version 3,因此已将 docker-compose 文件版本从 3.4 更改为 3 而不是运行docker-compose up --build

version: '3'

services:
  application.api.gateway:
    image: ${DOCKER_REGISTRY-}applicationapigateway
    build:
      context: .
      dockerfile: Application.API.Gateway/Dockerfile

  application.webapi:
    image: ${DOCKER_REGISTRY-}applicationwebapi
    build:
      context: .
      dockerfile: Application.WebAPI/Dockerfile

但是,当我尝试使用ecs-cli compose --project-name test-project service up --cluster-config test-config --ecs-profile test-profile如下错误进行部署时:

time="2021-09-29T15:22:50+10:00" level=error msg="Unable to open ECS Compose Project" error="Compose files must be of the same version. Found: 3 and 3.4"
time="2021-09-29T15:22:50+10:00" level=fatal msg="Unable to create and read ECS Compose Project" error="Compose files must be of the same version. Found: 3 and 3.4"

我还需要在哪里更新 dockerfile/docker-compose 版本?

其它文件,

dockerignore

**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md

标签: dockerdocker-composeamazon-ecs

解决方案


推荐阅读