简体   繁体   中英

docker-compose error what is this?

I want to docker-compose up this file:

identidock:
build: .
ports:
 - "5000:5000"
environment:
ENV: DEV
volumes:
 - ./app:/app

but it has a error:

ERROR: In file './docker-compose.yml', service 'build' must be a mapping not a string.

What should i do?

From the error message I guess the content of the docker-compose.yml file is not properly formatted as YAML.

Make it look like this (keep the leading spaces on all lines) and it will work; or, at least, you will encounter a different type of error:

identidock:
  build: .
  ports:
    - "5000:5000"
  environment:
    ENV: DEV
  volumes:
    - ./app:/app

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM