add: version cmd

add: dockerfile
This commit is contained in:
2024-03-13 00:11:34 +08:00
parent 2a6e427c4c
commit 4c2ea5896b
8 changed files with 138 additions and 4 deletions

17
Dockerfile Normal file
View File

@@ -0,0 +1,17 @@
FROM golang:1.21 as builder
LABEL authors="nite07"
WORKDIR /app
COPY . .
RUN go mod download
ARG version
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w -X sub2clash/config.Version=${version}" -o sub2sing-box main.go
FROM alpine:latest
COPY --from=builder /app/sub2sing-box /app/sub2sing-box
ENTRYPOINT ["/app/sub2sing-box","server"]