mirror of
https://github.com/luxfi/warp.git
synced 2026-10-30 15:13:04 +00:00
Workspace-wide sync. luxfi/node already shipped on 1.26.4 in v1.30.6 (commit 121aca1fa9); this is the cross-repo catch-up.
45 lines
818 B
Docker
45 lines
818 B
Docker
# Build stage
|
|
FROM golang:1.26.4-alpine AS builder
|
|
|
|
# Install build dependencies
|
|
RUN apk add --no-cache git make gcc musl-dev linux-headers
|
|
|
|
# Set working directory
|
|
WORKDIR /build
|
|
|
|
# Copy go mod files
|
|
COPY go.mod go.sum ./
|
|
|
|
# Download dependencies
|
|
RUN go mod download
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Build the CLI binary
|
|
RUN make build-cli
|
|
|
|
# Runtime stage
|
|
FROM alpine:latest
|
|
|
|
# Install runtime dependencies
|
|
RUN apk add --no-cache ca-certificates
|
|
|
|
# Create non-root user
|
|
RUN addgroup -g 1000 warp && \
|
|
adduser -u 1000 -G warp -s /bin/sh -D warp
|
|
|
|
# Copy binary from builder
|
|
COPY --from=builder /build/build/warp-cli /usr/local/bin/warp
|
|
|
|
# Set ownership
|
|
RUN chown -R warp:warp /usr/local/bin/warp
|
|
|
|
# Switch to non-root user
|
|
USER warp
|
|
|
|
# Set entrypoint
|
|
ENTRYPOINT ["warp"]
|
|
|
|
# Default command shows help
|
|
CMD ["--help"] |