Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,9 @@ ARG ARCH
FROM golang:1.23@sha256:540d3442f4758da82e787d03930bf6468cf6f8613474135e8946259b9e531ea0 AS builder

WORKDIR /workspace
# Add kubectl tool

# Using the $ARCH in the name of the binary here ensures we don't get any cross-arch caching after this binary is downloaded.
ARG ARCH
# kubectl latest version can be retrieved by curl -L -s https://dl.k8s.io/release/stable.txt
ARG KUBECTL_VERSION=v1.31.1
RUN curl -L "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/${ARCH}/kubectl" -o kubectl-${ARCH} && \
chmod +x ./kubectl-${ARCH}

# Copy the Go Modules manifests
COPY go.mod go.mod
Expand All @@ -51,15 +47,19 @@ RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -ldflags="${LDFLAGS}" -gcflags="${GCFLAGS}" -o manager main.go

FROM --platform=linux/${ARCH} bitnami/kubectl:1.31.1 AS kubectl

FROM --platform=linux/${ARCH} registry.access.redhat.com/ubi8-micro:8.10

ARG ARCH

WORKDIR /
COPY --from=builder /workspace/manager .
COPY --from=builder /workspace/kubectl-${ARCH} /usr/local/bin/kubectl
COPY --from=builder /workspace/crds /crds

# Copy the kubectl binary
COPY --from=kubectl /opt/bitnami/kubectl/bin/kubectl /usr/local/bin/

# Default Certificates are missing in micro-ubi. These are need to fetch DOCA drivers image tags
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
COPY /webhook-schemas /webhook-schemas
Expand Down
Loading