-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (27 loc) · 716 Bytes
/
Dockerfile
File metadata and controls
38 lines (27 loc) · 716 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Build stage
FROM golang:1.23-alpine AS builder
WORKDIR /build
# Install build dependencies
RUN apk add --no-cache git
# Copy go mod files
COPY go.mod go.sum ./
RUN go mod download
# Copy full source after deps so local packages are available
COPY . .
# Build static binary
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
-ldflags="-w -s" \
-o diffkeeper \
.
# Minimal runtime
FROM alpine:3.19
# Install ca-certificates for HTTPS
RUN apk --no-cache add ca-certificates
WORKDIR /
# Copy agent binary
COPY --from=builder /build/diffkeeper /usr/local/bin/diffkeeper
# Create directories
RUN mkdir -p /data /deltas
# Set as entrypoint
ENTRYPOINT ["/usr/local/bin/diffkeeper"]
CMD ["--help"]