Skip to content

Commit 5b65e3d

Browse files
committed
update: change full.Dockerfile to use the debug variant of the distroless image.
1 parent d56329e commit 5b65e3d

2 files changed

Lines changed: 4 additions & 22 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ That's it. Labelgate watches your containers and syncs labels to Cloudflare auto
9595
> | `v0.1.0` | Exact version |
9696
> | `v0.1` | Latest patch in 0.1.x |
9797
> | `v0` | Latest minor in 0.x.x |
98-
> | `v0.1.0-full` | Alpine-based variant with shell and timezone data |
98+
> | `v0.1.0-full` | debug variant includes busybox shell |
9999
100100
## Features
101101

full.Dockerfile

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,38 +38,20 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build \
3838
-ldflags "-s -w -X github.com/channinghe/labelgate/internal/version.Version=${VERSION} -X github.com/channinghe/labelgate/internal/version.Commit=${COMMIT} -X github.com/channinghe/labelgate/internal/version.Date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
3939
-o /app/labelgate ./cmd/labelgate
4040

41-
# Stage 3: Runtime
42-
FROM alpine:3.21@sha256:c3f8e73fdb79deaebaa2037150150191b9dcbfba68b4a46d70103204c53f4709
41+
# Stage 3: Runtime — debug variant includes busybox shell for troubleshooting
42+
FROM gcr.io/distroless/static-debian13:debug-nonroot@sha256:b80e889821affbb581c2743235fe72fca378182a64e7e6313c36aa9a60f6f244
4343

4444
WORKDIR /app
4545

46-
# Install ca-certificates for HTTPS and tzdata for timezone support
47-
RUN apk add --no-cache ca-certificates tzdata
48-
49-
# Create non-root user
50-
RUN adduser -D -g '' labelgate
51-
52-
# Copy binary from builder
5346
COPY --from=builder /app/labelgate /app/labelgate
5447

55-
# Create directories for data and config
56-
RUN mkdir -p /app/config && \
57-
chown -R labelgate:labelgate /app/config
58-
59-
# Note: No config file copied — use environment variables for configuration
60-
# If you need a config file, mount it at /etc/labelgate/labelgate.yaml
61-
62-
# Switch to non-root user
63-
USER labelgate
48+
USER nonroot
6449

65-
# Expose ports
6650
# 8080: API Server + Dashboard
6751
# 8081: Agent Server (WebSocket)
6852
EXPOSE 8080 8081
6953

70-
# Health check
7154
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
7255
CMD ["/app/labelgate", "healthcheck"]
7356

74-
# Default command
7557
ENTRYPOINT ["/app/labelgate"]

0 commit comments

Comments
 (0)