## build image: FROM golang:1.15 as builder RUN mkdir -p /go/src/git.eeqj.de/sneak/formless WORKDIR /go/src/git.eeqj.de/sneak/formless COPY go.mod . COPY go.sum . RUN go mod download ADD . /go/src/git.eeqj.de/sneak/formless/ RUN make build ## output image: FROM scratch COPY --from=builder /go/src/git.eeqj.de/sneak/formless/formless /app/formless COPY --from=builder /go /go.archive WORKDIR /app ENV PORT 8080 ENV DBURL none EXPOSE 8080 CMD ["./formless"]