2020-04-11 21:27:24 +00:00
|
|
|
# build stage
|
|
|
|
FROM golang:1.13-stretch AS build-env
|
|
|
|
COPY . /src
|
|
|
|
WORKDIR /src
|
2020-05-09 20:44:28 +00:00
|
|
|
|
|
|
|
ENV GOPROXY=http://192.168.0.143:3000
|
|
|
|
|
2020-04-11 21:27:24 +00:00
|
|
|
ENV GO113MODULE=on
|
|
|
|
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go test ./... -cover -coverprofile=c.out #gosetup
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o goapp
|
|
|
|
|
|
|
|
# final stage
|
|
|
|
FROM alpine
|
|
|
|
LABEL maintainer="Alphyron <admin@dragon-labs.de>"
|
|
|
|
|
|
|
|
RUN apk update \
|
|
|
|
&& apk upgrade \
|
|
|
|
&& apk add --no-cache \
|
|
|
|
ca-certificates \
|
|
|
|
&& update-ca-certificates 2>/dev/null || true
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=build-env /src .
|
|
|
|
RUN chmod +x ./goapp
|
|
|
|
CMD [ "./goapp"]
|