docker-based-development-guide/golang/Dockerfile

19 lines
400 B
Docker
Raw Normal View History

FROM golang:1.12.5-alpine3.9 as dev
# installing git
RUN apk update && apk upgrade && \
apk add --no-cache git
RUN go get github.com/sirupsen/logrus
RUN go get github.com/buaazp/fasthttprouter
RUN go get github.com/valyala/fasthttp
WORKDIR /work
COPY ./src /work/
RUN go build -o app
###########START NEW IMAGE###################
FROM alpine:3.9 as prod
COPY --from=dev /work/app /
CMD ./app