github.com/shashidharatd/test-infra@v0.0.0-20171006011030-71304e1ca560/planter/Dockerfile (about) 1 # Copyright 2017 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 FROM debian:jessie 16 LABEL maintainer="Benjamin Elder <bentheelder@google.com>" 17 18 # Includes everything needed to build and test github.com/kubernetes/kubernetes 19 # and github.com/kubernetes/test-infra with bazel and run bazel as the host UID 20 21 ARG BAZEL_VERSION 22 23 WORKDIR "/workspace" 24 RUN mkdir -p "/workspace" 25 26 RUN apt-get update && apt-get install -y --no-install-recommends \ 27 build-essential \ 28 ca-certificates \ 29 git \ 30 python \ 31 python-pip \ 32 unzip \ 33 wget \ 34 zip \ 35 zlib1g-dev \ 36 && apt-get clean && \ 37 # TODO(bentheelder): we should probably have these as bazel dependencies, 38 # remove these from the container if kettle is fixed. 39 pip install pylint pyyaml 40 41 SHELL ["/bin/bash", "-c"] 42 43 RUN INSTALLER="bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh"; \ 44 if [[ "${BAZEL_VERSION}" =~ ([0-9\.]+)(rc[0-9]+) ]]; then \ 45 DOWNLOAD_URL="https://storage.googleapis.com/bazel/${BASH_REMATCH[1]}/${BASH_REMATCH[2]}/${INSTALLER}"; \ 46 else \ 47 DOWNLOAD_URL="https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/${INSTALLER}"; \ 48 fi; \ 49 wget -q "${DOWNLOAD_URL}" && \ 50 chmod +x "${INSTALLER}" && "./${INSTALLER}" && rm "${INSTALLER}" 51 52 # It turns out git and bazel pkg_tar and a bunch of other things fail if we 53 # don't have a /etc/passwd with the user in it, so let's solve that. 54 # We're making a fake world-writable one *inside* the container so that the 55 # entrypoint can write an entry to it with the user matching the host user 56 # this means we don't need to run the container as root! :-) 57 # We care about not running as root because it means build files are owned by 58 # the host users, not root (and logs, etc). 59 RUN touch /etc/passwd && chmod a+rw /etc/passwd 60 61 COPY ./entrypoint.sh / 62 ENTRYPOINT ["/entrypoint.sh"]