简体   繁体   中英

docker-compose unsupported config for services

I am using below version of docker and docker-compose -

Docker version 17.03.1-ce, build c6d412e

docker-compose version 1.11.2, build dfed245

I still face issues with -

ERROR: The Compose file './docker-compose.yml' is invalid because:
Unsupported config option for services.web: 'version'

below is my docker file -

version: '2'
services:
  web:
    build: .
    ports:
      - "80:80"
      - "443:443"
    links:
      - memache:memcahced
      - solr:solr
      - dev_mysql:dev_mysql
    container_name: xyz
    hostname: XYZ
    image: XYZ/mono
    version: latest
    privileged: true
 ...
 ...

Need some assistance.

Don't know if it's just your question, but the indentation of your compose file is off, and there are a number of typos.

Not clear what you're trying to do with that version property in the service definition (no such property is documented ), but if you want to specify the version of the image to be used, you do that as follows:

services:
  web:
    image: XYZ/mono:latest

As already some people pointed out, your indentation is broken. You can verify your docker-compose YAML files with docker-compose config . This checks docker-compose.yml . If you want to check a different YAML, you can specify it with -f , eg docker-compose -f docker-compose.prod.yml config

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