I have my Dockerfile in the root of directory with src/myapp folder, myapp contains myapp.go with main package.
src/myapp
myapp
myapp.go
Dockerfi
The official docs suggests the following Dockerfile:
FROM golang:1.8 WORKDIR /go/src/app COPY . . RUN go get -d -v ./... RUN go install -v ./... CMD ["app"]
Please, visit https://hub.docker.com/_/golang for more info