(已解决)ERROR: In file './docker-compose.yml', service 'networks' must be a mapping not an array

如题错误一般是docker-compose.yml的空格缩进问题导致,例如:

version: "3.0"

services:
  web:
    build: .
    ports:
      - "5000:5000"
  networks:  # 缩进不对
      - basic

  redis:
    image: "redis:alpine"
    networks:
      - basic

networks:
  basic:
posted @ 2020-07-14 20:46  笑得开心  阅读(10366)  评论(0编辑  收藏  举报