forked from skx/tunneller
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (15 loc) · 662 Bytes
/
Dockerfile
File metadata and controls
28 lines (15 loc) · 662 Bytes
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.12-alpine as builder
RUN apk update && apk add --no-cache git ca-certificates && update-ca-certificates
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
WORKDIR /go/src/github.com/skx/tunneller/
COPY . .
RUN GO111MODULE=on go mod download
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags '-w -extldflags "static"'''
FROM scratch
WORKDIR /app
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /etc/passwd /etc/passwd
USER appuser
COPY --from=builder /go/src/github.com/skx/tunneller/tunneller .
ENTRYPOINT ["/app/tunneller"]
CMD ["serve", "-host", "0.0.0.0"]