Skip to content

fix(docker): make kubectl-delivery base image and k8s version configurable#2

Open
vicoooo26 wants to merge 2 commits into
AliyunContainerService:developfrom
vicoooo26:fix/kubectl-delivery
Open

fix(docker): make kubectl-delivery base image and k8s version configurable#2
vicoooo26 wants to merge 2 commits into
AliyunContainerService:developfrom
vicoooo26:fix/kubectl-delivery

Conversation

@vicoooo26

Copy link
Copy Markdown
Collaborator

What this PR does / why we need it:

Makes the kubectl-delivery Dockerfile more flexible by extracting hardcoded Alpine and Kubernetes versions into build args:

  • ALPINE_VERSION (default 3.22) — replaces the hardcoded alpine:3.17 in both build and final stages
  • K8S_VERSION (default v1.30.7) — replaces the hardcoded ENV K8S_VERSION with an ARG, allowing override via --build-arg

This also upgrades the Alpine base from 3.17 to 3.22, bringing security fixes and updated packages. Both values can now be overridden at build time without editing the Dockerfile.

@github-actions

Copy link
Copy Markdown

🎉 Welcome to the Kubeflow Trainer! 🎉

Thanks for opening your first PR! We're happy to have you as part of our community 🚀

Here's what happens next:

  • If you haven't already, please check out our Contributing Guide for repo-specific guidelines and the Kubeflow Contributor Guide for general community standards.
  • Our team will review your PR soon! cc @kubeflow/kubeflow-trainer-team

Join the community:

Feel free to ask questions in the comments if you need any help or clarification!
Thanks again for contributing to Kubeflow! 🙏

…rable

Add ALPINE_VERSION (default 3.22) and K8S_VERSION (default v1.30.7)
as build args so they can be overridden via --build-arg without
editing the Dockerfile.

Signed-off-by: Vico Chu <vico24826@gmail.com>
@vicoooo26
vicoooo26 force-pushed the fix/kubectl-delivery branch from 50b5d5b to 3b339d4 Compare July 15, 2026 11:46

@cheyang cheyang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified this locally: built the image with defaults (→ alpine 3.22.5, kubectl v1.30.7) and with --build-arg ALPINE_VERSION=3.20 --build-arg K8S_VERSION=v1.29.10 (→ alpine 3.20.10, kubectl v1.29.10). The global ARG ALPINE_VERSION declared before the first FROM is correctly referenced by both stages. Looks good.

Optional, non-blocking: the kubectl download still isn’t checksum-verified (pre-existing). Since you’re already touching this file, adding a sha256 check would be a nice hardening.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes the kubectl-delivery container image easier to customize by parameterizing previously hardcoded versions in the Dockerfile, while also upgrading the default Alpine base image.

Changes:

  • Introduces ARG ALPINE_VERSION=3.22 and uses it for both build and runtime stages (FROM alpine:${ALPINE_VERSION}).
  • Switches Kubernetes version from a hardcoded ENV to ARG K8S_VERSION=v1.30.7 so it can be overridden at build time.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Download the official .sha256 from dl.k8s.io and verify the binary
before installing, preventing use of a tampered kubectl.
@vicoooo26
vicoooo26 changed the base branch from release-1.9 to develop July 24, 2026 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants