forked from EmerisHQ/tracelistener
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
28 lines (19 loc) · 825 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
FROM golang:1.18-alpine3.14 as builder
ARG GIT_TOKEN
ARG SDK_TARGET
RUN set -eux; apk add --no-cache ca-certificates build-base;
RUN apk add git jq bash findutils
RUN go env -w GOPRIVATE=github.com/emerishq,github.com/allinbits
RUN git config --global url."https://git:${GIT_TOKEN}@github.com".insteadOf "https://github.com"
WORKDIR /app
COPY . .
RUN make clean
RUN CGO_ENABLED=0 GOPROXY=direct make setup-${SDK_TARGET}
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
CGO_ENABLED=0 GOPROXY=direct make build-${SDK_TARGET}
FROM alpine:latest
RUN apk --no-cache add ca-certificates mailcap tar curl && addgroup -S app && adduser -S app -G app
COPY --from=builder /app/build/tracelistener /usr/local/bin/tracelistener
USER app
ENTRYPOINT ["/usr/local/bin/tracelistener"]