docker-compose invalid type in volume

I am getting a following error when I run docker-compose up: *volumes contains an invalid type, it should be a string* my docker-compose file: data-emitter: build: context: DataEmitter dockerfile: ./Dockerfile volumes: - type: bind source: ./DataEmitter/data/logs.txt target: /data/logs.txt read_only: true Since there is a type: bind, what is the problem here?
2 answers

Docker compose versions are not compatible, because of that they don't support all functions, you have to read the documentation of the version.


Installing the newest version of docker-compose should solve this issue.

Current docker-compose is probably installed via 'apt-get install'.

If the 'docker-compose -v' is not 1.27.4 (currently newest version)

Run following:

'sudo curl -L "$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose'

Instead of VERSION you put 1.27.4 which is the currently newest version.

Afterwards apply executable permissions on the downloaded binary:
'sudo chmod +x /usr/local/bin/docker-compose'

Now after running 'docker-compose -v' you should have the '1.27.4' version and the Dockerfile should not throw an error.