Files
Boris LublinskyandGitHub bc90674d54 Added security to the API server (#1677)
Right now API server access is completely opened. This defines the approach to secure API server and provides a very simple implementation.

Securing API server endpoint

Related issue number
Closes #1376
2023-11-30 10:35:59 -08:00

24 lines
642 B
Docker

# Build security proxy
FROM registry.access.redhat.com/ubi9/go-toolset:1.20.10 as builder
WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
# Copy the go source
COPY ./ ./
# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o security_proxy cmd/main.go
FROM scratch
WORKDIR /workspace
COPY --from=builder /workspace/security_proxy /usr/local/bin/security_proxy
ENTRYPOINT ["/usr/local/bin/security_proxy"]