github.com/abayer/test-infra@v0.0.5/images/kubekins-e2e/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 build environment for building and running kubernetes 16 # unit and integration tests 17 18 FROM gcr.io/k8s-testimages/bootstrap:v20180510-809cd85b5 19 LABEL maintainer "Sen Lu <senlu@google.com>" 20 21 # hint to kubetest that it is in CI 22 ENV KUBETEST_IN_DOCKER="true" 23 24 # Go standard envs 25 ENV GOPATH /go 26 ENV PATH /usr/local/go/bin:$PATH 27 ENV PATH $GOPATH/bin:$PATH 28 29 # setup k8s repo symlink 30 RUN mkdir -p /go/src/k8s.io/kubernetes \ 31 && ln -s /go/src/k8s.io/kubernetes /workspace/kubernetes 32 33 # preinstall: 34 # - graphviz package for graphing profiles 35 # - bc for shell to junit 36 # - rpm for building RPMs with Bazel 37 RUN apt-get install -y bc \ 38 graphviz \ 39 rpm 40 # preinstall this for kops tests xref kubetest prepareAws(...) 41 # TODO(bentheelder,krzyzacy,justisb,chrislovecnm): remove this 42 RUN pip install awscli 43 44 # install cfssl to prevent https://github.com/kubernetes/kubernetes/issues/55589 45 # The invocation at the end is to prevent download failures downloads as in the bug. 46 # TODO(porridge): bump CFSSL_VERSION to one where cfssljson supports the -version flag and test it as well. 47 ARG CFSSL_VERSION 48 RUN wget -q -O cfssl "https://pkg.cfssl.org/${CFSSL_VERSION}/cfssl_linux-amd64" && \ 49 wget -q -O cfssljson "https://pkg.cfssl.org/${CFSSL_VERSION}/cfssljson_linux-amd64" && \ 50 chmod +x cfssl cfssljson && \ 51 mv cfssl cfssljson /usr/local/bin && \ 52 cfssl version 53 54 # install go 55 ARG GO_VERSION 56 ENV GO_TARBALL "go${GO_VERSION}.linux-amd64.tar.gz" 57 RUN wget -q "https://storage.googleapis.com/golang/${GO_TARBALL}" && \ 58 tar xzf "${GO_TARBALL}" -C /usr/local && \ 59 rm "${GO_TARBALL}" 60 61 # install bazel 62 ARG BAZEL_VERSION_ARG 63 ENV BAZEL_VERSION=${BAZEL_VERSION_ARG} 64 RUN INSTALLER="bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh"; \ 65 wget -q "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/${INSTALLER}" && \ 66 chmod +x "${INSTALLER}" && "./${INSTALLER}" && rm "${INSTALLER}" 67 68 # add env we can debug with the image name:tag 69 ARG IMAGE_ARG 70 ENV IMAGE=${IMAGE_ARG} 71 72 # everything below will be triggered on every new image tag ... 73 ADD ["kops-e2e-runner.sh", \ 74 "kubetest", \ 75 "https://raw.githubusercontent.com/kubernetes/kubernetes/master/cluster/get-kube.sh", \ 76 "/workspace/"] 77 RUN ["chmod", "+x", "/workspace/get-kube.sh"]