tiny-url-ex/Dockerfile

14 lines
299 B
Docker

FROM golang:alpine as builder
ENV GO111MODULE=on
RUN apk add git
ADD . /pkg
WORKDIR /pkg
RUN go get -d ./...
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o exec
FROM scratch
COPY --from=builder /pkg/exec /main
COPY --from=builder /pkg/api.json /api.json
EXPOSE 4242/tcp
ENTRYPOINT ["/main"]