Files
kubernetes/build/build-image/Dockerfile
k8s-merge-robot fc3316ee1b Merge pull request #20398 from mfanjie/mfanjie-patch-1
Auto commit by PR queue bot
2016-02-09 22:55:18 -08:00

66 lines
2.2 KiB
Docker

# Copyright 2016 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This file creates a standard build environment for building Kubernetes
# We replace KUBE_BUILD_IMAGE_CROSS in build/common.sh with the actual
# cross-build image tag.
FROM KUBE_BUILD_IMAGE_CROSS
MAINTAINER Joe Beda <jbeda@google.com>
ENV GOOS linux
ENV GOARCH amd64
ENV http_proxy KUBE_BUILD_HTTP_PROXY
ENV https_proxy KUBE_BUILD_HTTPS_PROXY
ENV no_proxy KUBE_BUILD_NO_PROXY
# work around 64MB tmpfs size in Docker 1.6
ENV TMPDIR /tmp.k8s
# Get the code coverage tool and godep
RUN mkdir $TMPDIR && \
go get golang.org/x/tools/cmd/cover github.com/tools/godep
# We use rsync to copy some binaries around. It is faster (0.3s vs. 1.1s) on my
# machine vs. `install`
RUN rm -rf /var/lib/apt/lists/ \
&& apt-get -o Acquire::Check-Valid-Until=false update \
&& apt-get install -y rsync \
&& rm -rf /var/lib/apt/lists/
# Download and symlink etcd. We need this for our integration tests.
RUN export ETCD_VERSION=v2.2.1; \
mkdir -p /usr/local/src/etcd &&\
cd /usr/local/src/etcd &&\
curl -fsSLO https://github.com/coreos/etcd/releases/download/$ETCD_VERSION/etcd-$ETCD_VERSION-linux-amd64.tar.gz &&\
tar xzf etcd-$ETCD_VERSION-linux-amd64.tar.gz &&\
ln -s ../src/etcd/etcd-$ETCD_VERSION-linux-amd64/etcd /usr/local/bin/
# Mark this as a kube-build container
RUN touch /kube-build-image
WORKDIR /go/src/k8s.io/kubernetes
# Propagate the git tree version into the build image
ADD kube-version-defs /kube-version-defs
ENV KUBE_GIT_VERSION_FILE /kube-version-defs
# Make output from the dockerized build go someplace else
ENV KUBE_OUTPUT_SUBPATH _output/dockerized
# Upload Kubernetes source
ADD kube-source.tar.gz /go/src/k8s.io/kubernetes/