Go version update to 1.12.9
[ta/caas-helm.git] / docker-build / helm-builder / Dockerfile
1 # Copyright 2019 Nokia
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 centos:7.6.1810
16 MAINTAINER Krisztian Lengyel <krisztian.lengyel@nokia.com>
17
18 ARG HELM_VERSION
19 ARG go_version
20 ARG binaries
21 ARG go_install_dir="/usr/local/go"
22
23 ENV GOBIN=/usr/local/bin
24 ENV GOPATH /build
25 ARG build_packages="gcc gcc-c++ glibc-devel make autoconf git which libtool"
26 ENV PATH="$GOPATH/bin:$go_install_dir/bin:$PATH"
27
28 RUN yum install -y --setopt=skip_missing_names_on_install=False \
29       ${build_packages} \
30 &&  mkdir -p $go_install_dir \
31 &&  curl -fsSL -k https://dl.google.com/go/go${go_version}.linux-amd64.tar.gz | tar zx --strip-components=1 -C ${go_install_dir} \
32 \
33 # Build Helm
34 &&  mkdir -p $GOPATH/src/k8s.io \
35 &&  cd $GOPATH/src/k8s.io \
36 &&  git clone https://github.com/kubernetes/helm.git \
37 &&  cd helm \
38 &&  make GIT_TAG=v${HELM_VERSION} bootstrap build-cross \
39 &&  mkdir -p ${binaries} \
40 &&  mv ./_dist/linux-amd64/tiller ${binaries}/ \
41 &&  mv ./_dist/linux-amd64/helm ${binaries}/ \
42 &&  rm -rf $GOPATH \
43 &&  rm -rf $go_install_dir \
44 &&  rm -rf /build \
45 &&  rm -rf /root/.glide