k8s.io/kubernetes@v1.31.0-alpha.0.0.20240520171757-56147500dadc/build/build-image/Dockerfile (about)

     1  # Copyright 2016 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 creates a standard build environment for building Kubernetes
    16  ARG KUBE_CROSS_IMAGE
    17  ARG KUBE_CROSS_VERSION
    18  
    19  FROM ${KUBE_CROSS_IMAGE}:${KUBE_CROSS_VERSION}
    20  
    21  # Mark this as a kube-build container
    22  RUN touch /kube-build-image
    23  
    24  # To run as non-root we sometimes need to rebuild go stdlib packages.
    25  RUN chmod -R a+rwx /usr/local/go/pkg
    26  
    27  # For running integration tests /var/run/kubernetes is required
    28  # and should be writable by user
    29  RUN mkdir /var/run/kubernetes && chmod a+rwx /var/run/kubernetes
    30  
    31  # The kubernetes source is expected to be mounted here.  This will be the base
    32  # of operations.
    33  ENV HOME=/go/src/k8s.io/kubernetes
    34  WORKDIR ${HOME}
    35  
    36  # Make output from the dockerized build go someplace else
    37  ENV KUBE_OUTPUT_SUBPATH=_output/dockerized
    38  
    39  # Pick up version stuff here as we don't copy our .git over.
    40  ENV KUBE_GIT_VERSION_FILE=${HOME}/.dockerized-kube-version-defs
    41  
    42  # Add system-wide git user information
    43  RUN git config --system user.email "nobody@k8s.io" \
    44    && git config --system user.name "kube-build-image"
    45  
    46  # Fix permissions on gopath
    47  RUN chmod -R a+rwx $GOPATH
    48  
    49  # Make log messages use the right timezone
    50  ADD localtime /etc/localtime
    51  RUN chmod a+r /etc/localtime
    52  
    53  # Set up rsyncd
    54  ADD rsyncd.password /
    55  RUN chmod a+r /rsyncd.password
    56  ADD rsyncd.sh /
    57  RUN chmod a+rx /rsyncd.sh