Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Use bitnami docker image for kubectl #1109

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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/
e0ne marked this conversation as resolved.
Show resolved Hide resolved

# 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