Dockerfile 1.8 KB

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