Compose: Invalid type in volume, it should be a string.

Created on 26 Apr 2017  路  3Comments  路  Source: docker/compose

Trying to setup a bind volume and it does not work:

Followed the documentation to write the docker-compose file:

version: '3'
services:
  web:
    #build: .
    image: fnndsc/fnndsc.babymri.org
    ports:
      - "8060:8080"
    volumes:
      - type: bind
        source: .
        target: /src/website
    labels:
      name: "FNNDSC Web App"
      role: "FNNDSC Web App development server"

Docker version 17.03.1-ce, build c6d412e

docker-compose version 1.12.0, build b31ff33

docker-compose up:

ERROR: The Compose file './docker-compose.yml' is invalid because:
services.web.volumes contains an invalid type, it should be a string
kinquestion

Most helpful comment

You need version: '3.2' for the extended notation.

All 3 comments

You need version: '3.2' for the extended notation.

Thanks!

This is helpful. I assumed that '3' implied the latest version of the 2nd component, but apparently you have to explicitly specify and subsequently upgrade the 2nd component of the version.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidbarratt picture davidbarratt  路  3Comments

bitver picture bitver  路  3Comments

saulshanabrook picture saulshanabrook  路  3Comments

dimsav picture dimsav  路  3Comments

29e7e280-0d1c-4bba-98fe-f7cd3ca7500a picture 29e7e280-0d1c-4bba-98fe-f7cd3ca7500a  路  3Comments