gpt4 book ai didi

docker - yaml.parser.ParserError-为什么不起作用?

转载 作者:行者123 更新时间:2023-12-02 20:29:57 26 4
gpt4 key购买 nike

怎么了?

$ docker-compose up
ERROR: yaml.parser.ParserError: while parsing a block collection
in "./docker-compose.yml", line 23, column 9
expected <block end>, but found '?'
in "./docker-compose.yml", line 24, column 9
docker-compose.yml:
version: '3'
services:
idserver:
image: israelinfo-idserver
# ports:
# - "5000:5000"
volumes:
- idserver-data:/home/vhosts/israelinfo/data
networks:
- back
nginx:
image: israelinfo-nginx
ports:
- "443:443"
networks:
- back
networks:
back:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.16.238.0/24
gateway: 172.16.238.1
volumes:
idserver-data:

最佳答案

有两个错误:

IPAM的

  • 网关是撰写文件版本2的功能
  • 如larsks所建议,您需要再缩进两个空格

  • Note: Additional IPAM configurations, such as gateway, are only honored for version 2 at the moment.



    (文档链接 https://docs.docker.com/compose/compose-file/#ipam)

    关于docker - yaml.parser.ParserError-为什么不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59161190/

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