-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.relay
More file actions
39 lines (27 loc) · 862 Bytes
/
Dockerfile.relay
File metadata and controls
39 lines (27 loc) · 862 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
39
# Build stage
FROM golang:1.25-alpine AS builder
WORKDIR /app
# Copy go mod files
COPY go.mod go.sum ./
RUN go mod download
# Copy source code
COPY cmd/ cmd/
COPY internal/ internal/
# Build binary
RUN CGO_ENABLED=0 GOOS=linux go build -o gatekeeper-relay ./cmd/gatekeeper-relay
# Runtime stage
FROM alpine:3.23.3
LABEL org.opencontainers.image.source=https://github.com/Tight-Line/gatekeeper
RUN apk --no-cache add ca-certificates
WORKDIR /app
# Copy binary from builder
COPY --from=builder /app/gatekeeper-relay .
# Create non-root user
RUN addgroup -g 1000 gatekeeper && \
adduser -u 1000 -G gatekeeper -s /bin/sh -D gatekeeper && \
mkdir -p /etc/gatekeeper && \
chown -R gatekeeper:gatekeeper /app /etc/gatekeeper
USER gatekeeper
# Run the relay client
ENTRYPOINT ["./gatekeeper-relay"]
CMD ["-config", "/etc/gatekeeper/config.yaml"]