group_helper/Dockerfile
2020-08-09 10:07:16 +02:00

29 lines
648 B
Docker

# build stage
FROM golang:1.13-stretch AS build-env
WORKDIR /src
COPY go.mod /src/go.mod
RUN go mod download
COPY . /src
#ENV GOPROXY=http://192.168.0.143:3000
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"]