FROM golang:1.17-alpine as dev WORKDIR /go/src/weather COPY ./go.mod . COPY ./go.sum . RUN go mod download COPY . . RUN go install ./... CMD [ "go", "run", "cmd/weather/main.go"] from alpine WORKDIR /bin COPY --from=dev /go/bin/weather ./weather CMD [ "weather" ]