github.com/munnerz/test-infra@v0.0.0-20190108210205-ce3d181dc989/images/kubekins-test/Dockerfile-1.11 (about)

     1  # Copyright 2018 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 golang:1.10.7
    19  LABEL maintainer="Sen Lu <senlu@google.com>"
    20  
    21  # Setup workspace and symlink to gopath
    22  WORKDIR /workspace
    23  RUN mkdir -p /go/src/k8s.io/kubernetes /workspace \
    24      && ln -s /go/src/k8s.io/kubernetes /workspace/kubernetes
    25  ENV WORKSPACE=/workspace \
    26      TERM=xterm
    27  
    28  # Install linux packages
    29  # bc is needed by shell2junit
    30  # dnsutils is needed by federation cluster scripts.
    31  # file is used when uploading test artifacts to GCS.
    32  # jq is used by hack/verify-godep-licenses.sh
    33  # python-pip is needed to install the AWS cli.
    34  # netcat is used by integration test scripts.
    35  RUN apt-get -o Acquire::Check-Valid-Until=false update && apt-get install -y \
    36  	bc \
    37  	dnsutils \
    38  	file \
    39  	jq \
    40  	python-pip \
    41  	netcat-openbsd \
    42  	rsync \
    43  	--no-install-recommends \
    44  	&& rm -rf /var/lib/apt/lists/*
    45  
    46  
    47  
    48  # Install Docker deps, some of these are already installed in the image but
    49  # that's fine since they won't re-install and we can reuse the code below
    50  # for another image someday.
    51  RUN apt-get update && apt-get install -y --no-install-recommends \
    52      apt-transport-https \
    53      ca-certificates \
    54      curl \
    55      gnupg2 \
    56      software-properties-common \
    57      lsb-release
    58  
    59  # Add the Docker apt-repository
    60  RUN curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg \
    61      | apt-key add - && \
    62      add-apt-repository \
    63      "deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") \
    64      $(lsb_release -cs) stable"
    65  
    66  # Install Docker
    67  # TODO(bentheelder): the `sed` is a bit of a hack, look into alternatives.
    68  # Why this exists: `docker service start` on debian runs a `cgroupfs_mount` method,
    69  # We're already inside docker though so we can be sure these are already mounted.
    70  # Trying to remount these makes for a very noisy error block in the beginning of
    71  # the pod logs, so we just comment out the call to it... :shrug:
    72  # TODO(benthelder): update docker version. This is pinned because of
    73  # https://github.com/kubernetes/test-infra/issues/6187
    74  RUN apt-get update && \
    75      apt-get install -y --no-install-recommends docker-ce=17.09.1~ce-0~debian && \
    76      sed -i 's/cgroupfs_mount$/#cgroupfs_mount\n/' /etc/init.d/docker
    77  
    78  
    79  
    80  # Install any go packages
    81  RUN go get \
    82      github.com/golang/lint/golint