mirror of
https://github.com/hanzo-ml/kuberay.git
synced 2026-10-30 19:48:47 +00:00
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
24 lines
642 B
Docker
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"]
|