-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
27 lines (20 loc) · 842 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
FROM golang:1.14-alpine as builder
RUN mkdir -p /go/src/github.com/jfardello/tlsrproxy &&\
apk update && apk add --no-cache git ca-certificates tzdata &&\
update-ca-certificates && adduser -D -g '' appuser
WORKDIR /go/src/github.com/jfardello/tlsrproxy
COPY go.mod .
COPY go.sum .
RUN go mod download
#get deps before code to ensure external modules ge cached by podman.
COPY . .
RUN GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o /usr/local/bin/tlsrproxy
FROM alpine
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /usr/local/bin/tlsrproxy /usr/local/bin/tlsrproxy
COPY tlsrproxy.yaml /config/tlsrproxy.yaml
USER appuser
EXPOSE 8888
ENTRYPOINT ["/usr/local/bin/tlsrproxy"]