使用docker build可以很好地构建映像,但是stat / GO / src / main:docker-compose不会遇到此类文件或目录

I have a Dockerfile which I can successfully build an image from:

FROM iron/go:dev
RUN mkdir /app
COPY src/main/main.go /app/.
# Set an env var that matches your github repo name, replace treeder/dockergo here with your repo name
ENV SRC_DIR=/app
# Add the source code:
ADD . $SRC_DIR
# Build it:
RUN go get goji.io
RUN go get gopkg.in/mgo.v2
RUN cd $SRC_DIR; go build -o main
ENTRYPOINT ["/app/main"]

However, when I attempt to build the following docker-compose.yml file:

version: "3.3"

services:
  api:
    build: ./api
    expose:
      - '8080'
    container_name: 'api'
    ports:
      - "8082:8080"
    depends_on:
      - db
    networks:
      - api-net

  db:
    build: ./db
    expose:
      - '27017'
    container_name: 'mongo'
    ports:
      - "27017:27017"
    networks:
      - api-net

networks:
  api-net:
    driver: bridge

I get:

Removing api mongo is up-to-date Recreating

532e3cf66460_carsupermarket_api_1 ... error

ERROR: for 532e3cf66460_carsupermarket_api_1 Cannot start service api: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"/GO/src/main\": stat /GO/src/main: no such file or directory": unknown

ERROR: for api Cannot start service api: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"/GO/src/main\": stat /GO/src/main: no such file or directory": unknown ERROR: Encountered errors while bringing up the project.

I suspect that docker-compose is introducing some nuance when it comes to directory build paths, however, I'm at a loss as to why my image is building from the docker file when using docker build ., but failing when I try to incorporate this into docker-compose.

Can someone point me in the right direction as to what I am doing wrong?

I've upgraded to the latest version of Docker CE (18.03.1-ce, build 9ee9f40) and this appears to have resolved the issue.