Failed to execute script docker-compose

Description of the issue

Fresh install of docker, seem to be getting a rather strange error when trying to
build with docker-compose build and the most simple of build files.

Context information (for bug reports)

Output of docker-compose version

docker-compose version 1.27.4, build 40524192
docker-py version: 4.3.1
CPython version: 3.7.7
OpenSSL version: OpenSSL 1.1.1g  21 Apr 2020

Output of docker version

Client: Docker Engine - Community
 Cloud integration: 1.0.2
 Version:           19.03.13
 API version:       1.40
 Go version:        go1.13.15
 Git commit:        4484c46d9d
 Built:             Wed Sep 16 16:58:31 2020
 OS/Arch:           darwin/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.13
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       4484c46d9d
  Built:            Wed Sep 16 17:07:04 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.3.7
  GitCommit:        8fba4e9a7d01810a393d5d25a3621dc101981175
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Output of docker-compose config
(Make sure to add the relevant -f and other flags)

services:
  webapp:
    build:
      context: /Users/aleccooper/Github/Strava-Rankings/Strava-Ranking/StravaRanking/ranking_app
version: '3.8'

Steps to reproduce the issue

  1. create following simple docker-compose.yml file
version: "3.8"

services:
  webapp:
    build: ./ranking_app
  1. run docker-compose build

Observed result

Build fails with the below error

Expected result

Expect build to pass

Stacktrace / full error message

Traceback (most recent call last):
File “compose/cli/main.py”, line 67, in main
File “compose/cli/main.py”, line 126, in perform_command
File “compose/cli/main.py”, line 302, in build
File “compose/project.py”, line 468, in build
File “compose/project.py”, line 450, in build_service
File “compose/service.py”, line 1147, in build
compose.service.BuildError: (<Service: web>, {‘message’: ‘Cannot locate specified Dockerfile: Dockerfile’})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “docker-compose”, line 3, in
File “compose/cli/main.py”, line 78, in main
TypeError: can only concatenate str (not “dict”) to str
[2640] Failed to execute script docker-compose

Additional information

OS version / distribution, docker-compose install method, etc.

macOS Catalina 10.15.7

1 possible answer(s) on “Failed to execute script docker-compose

  1. the issue is caused by Dockerfile that is mentioned at build: is not found, it can be because of the relative/absolute path mix up. Try different paths at build: