...

Text file src/k8s.io/kubernetes/build/server-image/kube-apiserver/Dockerfile

Documentation: k8s.io/kubernetes/build/server-image/kube-apiserver

     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.
    16ARG BASEIMAGE
    17ARG SETCAP_IMAGE
    18
    19# we use the hosts platform to apply the capabilities to avoid the need
    20# to setup qemu for the builder.
    21FROM --platform=linux/$BUILDARCH ${SETCAP_IMAGE}
    22ARG BINARY
    23COPY ${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
    26RUN setcap cap_net_bind_service=+ep /${BINARY}
    27
    28FROM --platform=linux/$TARGETARCH ${BASEIMAGE}
    29ARG BINARY
    30COPY --from=0 /${BINARY} /usr/local/bin/${BINARY}

View as plain text