k8s.io/kubernetes@v1.31.0-alpha.0.0.20240520171757-56147500dadc/build/server-image/kube-apiserver/Dockerfile (about) 1 # Copyright 2021 The Kubernetes Authors. 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # http://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 15 # This file create the kube-apiserver image. 16 ARG BASEIMAGE 17 ARG SETCAP_IMAGE 18 19 # we use the hosts platform to apply the capabilities to avoid the need 20 # to setup qemu for the builder. 21 FROM --platform=linux/$BUILDARCH ${SETCAP_IMAGE} 22 ARG BINARY 23 COPY ${BINARY} /${BINARY} 24 # We apply cap_net_bind_service so that kube-apiserver can be run as 25 # non-root and still listen on port less than 1024 26 RUN setcap cap_net_bind_service=+ep /${BINARY} 27 28 FROM --platform=linux/$TARGETARCH ${BASEIMAGE} 29 ARG BINARY 30 COPY --from=0 /${BINARY} /usr/local/bin/${BINARY}