mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-16 14:45:28 +00:00
build/lib/release: Explicitly use '--platform' in building server images
When we switched to go-runner for building the apiserver, controller-manager, and scheduler server components, we no longer reference the individual architectures in the image names, specifically in the 'FROM' directive of the server image Dockerfiles. As a result, server images for non-amd64 images copy in the go-runner amd64 binary instead of the go-runner that matches that architecture. This commit explicitly sets the '--platform=linux/${arch}' to ensure we're pulling the correct go-runner arch from the manifest list. Before: FROM ${base_image} After: FROM --platform=linux/${arch} ${base_image} Signed-off-by: Stephen Augustus <saugustus@vmware.com>
This commit is contained in:
@@ -334,7 +334,7 @@ function kube::release::create_docker_images_for_server() {
|
||||
local images_dir
|
||||
binary_dir="$1"
|
||||
arch="$2"
|
||||
binaries=$(kube::build::get_docker_wrapped_binaries "${arch}")
|
||||
binaries=$(kube::build::get_docker_wrapped_binaries)
|
||||
images_dir="${RELEASE_IMAGES}/${arch}"
|
||||
mkdir -p "${images_dir}"
|
||||
|
||||
@@ -375,7 +375,7 @@ function kube::release::create_docker_images_for_server() {
|
||||
ln "${KUBE_ROOT}/build/nsswitch.conf" "${docker_build_path}/nsswitch.conf"
|
||||
chmod 0644 "${docker_build_path}/nsswitch.conf"
|
||||
cat <<EOF > "${docker_file_path}"
|
||||
FROM ${base_image}
|
||||
FROM --platform=linux/${arch} ${base_image}
|
||||
COPY ${binary_name} /usr/local/bin/${binary_name}
|
||||
EOF
|
||||
# ensure /etc/nsswitch.conf exists so go's resolver respects /etc/hosts
|
||||
|
Reference in New Issue
Block a user