forked from traefik/mesh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
43 lines (32 loc) · 985 Bytes
/
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
# 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/*
ENV PROJECT_WORKING_DIR=/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
WORKDIR "${PROJECT_WORKING_DIR}"
COPY go.mod go.sum "${PROJECT_WORKING_DIR}"/
RUN GO111MODULE=on GOPROXY=https://proxy.golang.org go mod download
COPY . "${PROJECT_WORKING_DIR}/"
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=maker /go/src/github.com/containous/maesh/dist/maesh /app/
ENTRYPOINT ["/app/maesh"]