Go version update to 1.12.9 02/1502/7
authorBalazs Szekeres <balazs.szekeres@nokia.com>
Fri, 30 Aug 2019 12:04:32 +0000 (14:04 +0200)
committerBalazs Szekeres <balazs.szekeres@nokia.com>
Tue, 3 Sep 2019 20:02:10 +0000 (22:02 +0200)
Change-Id: If66b436dbf3a33145b8ee30fb5011268542848d5
Signed-off-by: Balazs Szekeres <balazs.szekeres@nokia.com>
docker-build/cpupooler/Dockerfile
docker-build/process-starter/Dockerfile
rpmbuild.spec

index aeba20d..8267df1 100644 (file)
 FROM alpine:3.9
 MAINTAINER Balazs Szekeres <balazs.szekeres@nokia.com>
 
-ARG DEPENDENCY_MANAGER
-ENV DEP_VERSION=$DEPENDENCY_MANAGER
-ARG CPUPOOLER
-ENV CPUPOOLER_VERSION=$CPUPOOLER
+ARG DEP_MAN_VERSION
+ARG CPUPOOLER_VERSION
+ARG go_install_dir="/usr/local/go"
+ARG go_version
 ENV GOPATH /build
-ENV PATH /usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ENV PATH $go_install_dir/bin:$PATH
 ENV BUILD_DIR="$GOPATH/src/github.com/nokia/CPU-Pooler"
 
 RUN apk update \
 &&  apk upgrade \
 &&  apk add --no-cache --virtual .build-deps build-base git mercurial go glide bash tar \
 &&  apk add --no-cache curl \
-&&  curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 \
+&&  mkdir -p $go_install_dir \
+&&  curl -fsSL -k https://dl.google.com/go/go${go_version}.src.tar.gz | tar zx --strip-components=1 -C ${go_install_dir} \
+&&  cd ${go_install_dir}/src/ \
+&&  ./make.bash \
+&&  curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v${DEP_MAN_VERSION}/dep-linux-amd64 \
 &&  chmod +x /usr/local/bin/dep \
 &&  mkdir -p $BUILD_DIR \
 &&  git clone https://github.com/nokia/CPU-Pooler.git $BUILD_DIR \
@@ -46,5 +50,6 @@ RUN apk update \
 &&  mv $BUILD_DIR/cpu-device-webhook /cpu-device-webhook \
 &&  apk del .build-deps \
 &&  rm -rf $GOPATH \
+&&  rm -rf $go_install_dir \
 &&  rm -rf /build \
 &&  rm -rf /root/.glide
index 92c0b75..0dbc5f9 100644 (file)
 FROM centos:7.6.1810
 MAINTAINER Balazs Szekeres <balazs.szekeres@nokia.com>
 
-ARG DEPENDENCY_MANAGER
-ENV DEP_VERSION=$DEPENDENCY_MANAGER
-ARG CPUPOOLER
-ENV CPUPOOLER_VERSION=$CPUPOOLER
+ARG DEP_MAN_VERSION
+ARG go_install_dir="/usr/local/go"
+ARG go_version
+ENV GOBIN=/usr/local/bin
 ENV GOPATH /build
-ENV BUILD_DIR="$GOPATH/src/github.com/nokia/CPU-Pooler"
+ENV PATH="$GOPATH/bin:$go_install_dir/bin:$PATH"
+ARG CPUPOOLER_VERSION
 
 RUN yum update -y \
 &&  yum install -y \
-      go \
       git \
       bash \
       glide \
@@ -38,18 +38,18 @@ RUN yum update -y \
       make \
       gcc \
       gcc-c++ \
-&&  rpm --import https://mirror.go-repo.io/centos/RPM-GPG-KEY-GO-REPO \
-&&  curl -s https://mirror.go-repo.io/centos/go-repo.repo | tee /etc/yum.repos.d/go-repo.repo \
-&&  yum install -y golang \
-&&  curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 \
+&&  mkdir -p $go_install_dir \
+&&  curl -fsSL -k https://dl.google.com/go/go${go_version}.linux-amd64.tar.gz | tar zx --strip-components=1 -C ${go_install_dir} \
+&&  curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v${DEP_MAN_VERSION}/dep-linux-amd64 \
 &&  chmod +x /usr/local/bin/dep \
-&&  mkdir -p $BUILD_DIR \
-&&  git clone https://github.com/nokia/CPU-Pooler.git $BUILD_DIR \
-&&  cd $BUILD_DIR \
+&&  mkdir -p $GOPATH/src/github.com/nokia/CPU-Pooler \
+&&  git clone https://github.com/nokia/CPU-Pooler.git $GOPATH/src/github.com/nokia/CPU-Pooler \
+&&  cd $GOPATH/src/github.com/nokia/CPU-Pooler \
 &&  git fetch --tags \
 &&  git checkout ${CPUPOOLER_VERSION} \
 &&  dep ensure --vendor-only \
 # process-starter
 &&  CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o process-starter ./cmd/process-starter \
-&&  mv $BUILD_DIR/process-starter /process-starter \
+&&  mv $GOPATH/src/github.com/nokia/CPU-Pooler/process-starter /process-starter \
+&&  rm -rf $go_install_dir \
 &&  rm -rf $GOPATH
index 6a9f159..f944bdd 100644 (file)
 %define COMPONENT_PART process-starter
 %define RPM_NAME caas-%{COMPONENT}
 %define RPM_MAJOR_VERSION 0.3.0
-%define RPM_MINOR_VERSION 3
+%define RPM_MINOR_VERSION 4
+%define go_version 1.12.9
 %define CPUPOOLER_VERSION d94704e4b2f9f91ee712c6385038413fb7aa064a
-%define DEPENDENCY_MANAGER_VERSION 0.5.0
+%define DEP_MAN_VERSION 0.5.0
 %define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION}
 %define PROCESS_STARTER_INSTALL_PATH /opt/bin/
 
@@ -57,8 +58,9 @@ docker build \
   --build-arg http_proxy="${http_proxy}" \
   --build-arg https_proxy="${https_proxy}" \
   --build-arg no_proxy="${no_proxy}" \
-  --build-arg DEPENDENCY_MANAGER="%{DEPENDENCY_MANAGER_VERSION}" \
-  --build-arg CPUPOOLER="%{CPUPOOLER_VERSION}" \
+  --build-arg go_version="%{go_version}" \
+  --build-arg DEP_MAN_VERSION="%{DEP_MAN_VERSION}" \
+  --build-arg CPUPOOLER_VERSION="%{CPUPOOLER_VERSION}" \
   --tag %{COMPONENT_PART}:builder \
   %{_builddir}/%{RPM_NAME}-%{RPM_MAJOR_VERSION}/docker-build/%{COMPONENT_PART}/
 
@@ -103,8 +105,9 @@ docker build \
   --build-arg http_proxy="${http_proxy}" \
   --build-arg https_proxy="${https_proxy}" \
   --build-arg no_proxy="${no_proxy}" \
-  --build-arg DEPENDENCY_MANAGER="%{DEPENDENCY_MANAGER_VERSION}" \
-  --build-arg CPUPOOLER="%{CPUPOOLER_VERSION}" \
+  --build-arg DEP_MAN_VERSION="%{DEP_MAN_VERSION}" \
+  --build-arg CPUPOOLER_VERSION="%{CPUPOOLER_VERSION}" \
+  --build-arg go_version="%{go_version}" \
   --tag %{COMPONENT}:%{IMAGE_TAG} \
   %{_builddir}/%{RPM_NAME}-%{RPM_MAJOR_VERSION}/docker-build/%{COMPONENT}/