docker compose文件无效,不允许附加属性tty

docker compose文件无效,不允许附加属性tty,docker,docker-compose,dockerfile,Docker,Docker Compose,Dockerfile,我真的需要这个错误的帮助,我不明白为什么我会有这个错误。谢谢 docker -v Docker version 1.13.1, build 092cba3 docker-compose -v docker-compose version 1.11.1, build 7c5d5e4 这是我的文件 version: '2.0' services: arcgis-server: container_name: "arcgis-server" image: "arcgis-ser

我真的需要这个错误的帮助,我不明白为什么我会有这个错误。谢谢

docker -v
Docker version 1.13.1, build 092cba3
docker-compose -v
docker-compose version 1.11.1, build 7c5d5e4
这是我的文件

version: '2.0'

services:
  arcgis-server:
    container_name: "arcgis-server"
    image: "arcgis-server:10.4.1"
    volumes:
      - "./license:/license"
      - "./arcgisserver:/arcgis/server/usr/directories"
      - "./config-store:/arcgis/server/usr/config-store"
    build:
      context: .
      dockerfile: "Dockerfile"
    ulimits:
      nproc: 25059
      nofile:
        soft: 65535
        hard: 65535
    ports:
      - "127.0.0.1:6080:6080"
      - "127.0.0.1:6443:6443"
      - "4001:4001"
      - "4002:4002"
      - "4004:4004"
    stdin_open: true
tty: true
这里是错误

docker-compose build
ERROR: The Compose file './docker-compose.yml' is invalid because:
Additional properties are not allowed ('tty' was unexpected)

You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version ("2.0", "2.1", "3.0") 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/

事实上,我在那台旧机器上测试,它工作得很好。我将感谢你的帮助。再次感谢

tty
需要定义为服务的设置,而不是顶级设置。Yaml文件对空间敏感,因此删除前导空格会使设置处于无效的顶层。使用以下语法进行修复:

version: '2.0'

services:
  arcgis-server:
    container_name: "arcgis-server"
    image: "arcgis-server:10.4.1"
    volumes:
      - "./license:/license"
      - "./arcgisserver:/arcgis/server/usr/directories"
      - "./config-store:/arcgis/server/usr/config-store"
    build:
      context: .
      dockerfile: "Dockerfile"
    ulimits:
      nproc: 25059
      nofile:
        soft: 65535
        hard: 65535
    ports:
      - "127.0.0.1:6080:6080"
      - "127.0.0.1:6443:6443"
      - "4001:4001"
      - "4002:4002"
      - "4004:4004"
    stdin_open: true
    tty: true