This commit is contained in:
+19
@@ -18,6 +18,25 @@ COPY *.go ./
|
||||
COPY --from=frontend /src/frontend/dist ./frontend/dist
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /ufile .
|
||||
|
||||
FROM golang:1.24-alpine AS cli-builder
|
||||
|
||||
ARG GOPROXY=https://proxy.golang.org,direct
|
||||
ARG VERSION=dev
|
||||
ARG COMMIT=unknown
|
||||
ENV GOPROXY=${GOPROXY}
|
||||
|
||||
WORKDIR /src
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY cmd/ufile-cli/ ./cmd/ufile-cli/
|
||||
COPY scripts/build-cli.sh ./scripts/build-cli.sh
|
||||
RUN VERSION="${VERSION}" COMMIT="${COMMIT}" ./scripts/build-cli.sh
|
||||
|
||||
FROM alpine:3.22 AS cli-artifacts
|
||||
|
||||
COPY --from=cli-builder /src/dist /dist
|
||||
CMD ["sh", "-c", "while :; do sleep 3600; done"]
|
||||
|
||||
FROM alpine:3.22
|
||||
|
||||
RUN addgroup -S -g 10001 ufile \
|
||||
|
||||
Reference in New Issue
Block a user