mirror of
https://github.com/xtaci/kcptun.git
synced 2024-04-21 12:32:32 +00:00
upd Dockerfile
This commit is contained in:
+6
-9
@@ -1,20 +1,17 @@
|
||||
FROM golang:1.20.6-alpine3.18 as builder
|
||||
MAINTAINER xtaci <daniel820313@gmail.com>
|
||||
ENV GO111MODULE=on
|
||||
ENV VERSION=`date -u +%Y%m%d`
|
||||
RUN apk update && \
|
||||
apk upgrade && \
|
||||
apk add git gcc libc-dev linux-headers
|
||||
RUN mkdir /build
|
||||
RUN cd /build
|
||||
RUN git clone https://github.com/xtaci/kcptun
|
||||
RUN cd kcptun
|
||||
RUN go build -mod=vendor -ldflags "-X main.VERSION=$VERSION -s -w" -o /build/client github.com/xtaci/kcptun/client
|
||||
RUN go build -mod=vendor -ldflags "-X main.VERSION=$VERSION -s -w" -o /build/server github.com/xtaci/kcptun/server
|
||||
RUN git clone https://github.com/xtaci/kcptun.git
|
||||
RUN cd kcptun && \
|
||||
go build -mod=vendor -ldflags "-X main.VERSION=$(date -u +%Y%m%d) -s -w" -o /client github.com/xtaci/kcptun/client && \
|
||||
go build -mod=vendor -ldflags "-X main.VERSION=$(date -u +%Y%m%d) -s -w" -o /server github.com/xtaci/kcptun/server
|
||||
|
||||
FROM alpine:3.18
|
||||
RUN apk add --no-cache iptables
|
||||
COPY --from=builder /build/client /bin
|
||||
COPY --from=builder /build/server /bin
|
||||
COPY --from=builder /client /bin
|
||||
COPY --from=builder /server /bin
|
||||
EXPOSE 29900/udp
|
||||
EXPOSE 12948
|
||||
|
||||
Reference in New Issue
Block a user