forked from traefik/mesh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
47 lines (35 loc) · 1.08 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Let's build maesh for linux-amd64
FROM golang:1.13-alpine AS base-image
# Package dependencies
RUN apk --no-cache --no-progress add \
bash \
gcc \
git \
make \
musl-dev \
mercurial \
curl \
tar \
ca-certificates \
tzdata \
&& update-ca-certificates \
&& rm -rf /var/cache/apk/*
WORKDIR /go/src/github.com/containous/maesh
# Download goreleaser binary to bin folder in $GOPATH
RUN curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sh
# Download golangci-lint binary to bin folder in $GOPATH
RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.22.2
ENV GO111MODULE on
COPY go.mod go.sum ./
RUN go mod download
COPY . .
FROM base-image as maker
ARG MAKE_TARGET=local-build
RUN make ${MAKE_TARGET}
## IMAGE
FROM alpine:3.10
RUN addgroup -g 1000 -S app && \
adduser -u 1000 -S app -G app
COPY --from=base-image /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=maker /go/src/github.com/containous/maesh/dist/maesh /app/
ENTRYPOINT ["/app/maesh"]