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 "https://github.com/docker/compose/releases/download//docker-compose-$(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.