mirror of
https://github.com/schollz/croc.git
synced 2024-11-24 16:23:47 +03:00
da8beb65bf
Go 1.17 introduces compiler improvement (https://golang.org/doc/go1.17#compiler) and supports module graph pruning (https://golang.org/ref/mod#graph-pruning) and lazy module loading (https://golang.org/ref/mod#lazy-loading). This commit applies the changes by running `go mod tidy -go=1.17` to enable module graph pruning and lazy module loading supported by Go 1.17 or higher. Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
17 lines
326 B
Docker
17 lines
326 B
Docker
FROM golang:1.17-alpine as builder
|
|
RUN apk add --no-cache git
|
|
WORKDIR /go/croc
|
|
COPY . .
|
|
RUN go build -v -ldflags="-s -w"
|
|
|
|
FROM alpine:latest
|
|
EXPOSE 9009
|
|
EXPOSE 9010
|
|
EXPOSE 9011
|
|
EXPOSE 9012
|
|
EXPOSE 9013
|
|
COPY --from=builder /go/croc/croc /go/croc/croc-entrypoint.sh /
|
|
USER nobody
|
|
ENTRYPOINT ["/croc-entrypoint.sh"]
|
|
CMD ["relay"]
|