-
Notifications
You must be signed in to change notification settings - Fork 141
/
Copy pathtmpl.Dockerfile
39 lines (30 loc) · 919 Bytes
/
tmpl.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
FROM golang:1.19-alpine AS builder
# 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/traefik/mesh
# Download goreleaser binary to bin folder in $GOPATH
RUN curl -sfL https://gist.githubusercontent.com/traefiker/6d7ac019c11d011e4f131bb2cca8900e/raw/goreleaser.sh | sh
ENV GO111MODULE on
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN GOARCH={{ .GoARCH }} GOARM={{ .GoARM }} make local-build
## IMAGE
FROM {{ .RuntimeImage }}
RUN addgroup -g 1000 -S app && \
adduser -u 1000 -S app -G app
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /go/src/github.com/traefik/mesh/dist/traefik-mesh /app/
ENTRYPOINT ["/app/traefik-mesh"]