From 78833edbb349f73dca1d0d9749c410d6a4711cdf Mon Sep 17 00:00:00 2001 From: Balazs Szekeres Date: Fri, 30 Aug 2019 14:27:00 +0200 Subject: [PATCH 1/1] Go updated to 1.12.9 Change-Id: I5d8540ef1228adf8374f5ab2970ca0c335d68b33 Signed-off-by: Balazs Szekeres --- SPECS/caas-custom_metrics.spec | 8 +++++--- SPECS/caas-metrics_server.spec | 10 ++++++---- SPECS/caas-prometheus.spec | 8 ++++---- docker-build/custom_metrics/Dockerfile | 14 ++++++++++---- docker-build/metrics_server/Dockerfile | 19 ++++++++++++------- docker-build/prometheus/Dockerfile | 15 ++++----------- 6 files changed, 41 insertions(+), 33 deletions(-) diff --git a/SPECS/caas-custom_metrics.spec b/SPECS/caas-custom_metrics.spec index 7ee14f4..98382e0 100644 --- a/SPECS/caas-custom_metrics.spec +++ b/SPECS/caas-custom_metrics.spec @@ -15,8 +15,9 @@ %define COMPONENT custom_metrics %define RPM_NAME caas-%{COMPONENT} %define RPM_MAJOR_VERSION 0.5.0 -%define RPM_MINOR_VERSION 1 -%define DEPENDENCY_MANAGER_VERSION 0.5.0 +%define RPM_MINOR_VERSION 2 +%define go_version 1.12.9 +%define DEP_MAN_VERSION 0.5.0 %define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION} Name: %{RPM_NAME} @@ -49,7 +50,8 @@ docker build \ --build-arg http_proxy="${http_proxy}" \ --build-arg https_proxy="${https_proxy}" \ --build-arg no_proxy="${no_proxy}" \ - --build-arg CUSTOM_METRICS="%{RPM_MAJOR_VERSION}" \ + --build-arg CUSTOM_METRICS_VERSION="%{RPM_MAJOR_VERSION}" \ + --build-arg go_version="%{go_version}" \ --tag %{COMPONENT}:%{IMAGE_TAG} \ %{_builddir}/%{RPM_NAME}-%{RPM_MAJOR_VERSION}/docker-build/%{COMPONENT}/ diff --git a/SPECS/caas-metrics_server.spec b/SPECS/caas-metrics_server.spec index 2c40908..c09b0dd 100644 --- a/SPECS/caas-metrics_server.spec +++ b/SPECS/caas-metrics_server.spec @@ -15,8 +15,9 @@ %define COMPONENT metrics_server %define RPM_NAME caas-%{COMPONENT} %define RPM_MAJOR_VERSION 0.3.3 -%define RPM_MINOR_VERSION 1 -%define DEPENDENCY_MANAGER_VERSION 0.5.0 +%define RPM_MINOR_VERSION 2 +%define go_version 1.12.9 +%define DEP_MAN_VERSION 0.5.0 %define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION} Name: %{RPM_NAME} @@ -49,8 +50,9 @@ docker build \ --build-arg http_proxy="${http_proxy}" \ --build-arg https_proxy="${https_proxy}" \ --build-arg no_proxy="${no_proxy}" \ - --build-arg METRICS_SERVER="%{RPM_MAJOR_VERSION}" \ - --build-arg DEPENDENCY_MANAGER="%{DEPENDENCY_MANAGER_VERSION}" \ + --build-arg METRICS_SERVER_VERSION="%{RPM_MAJOR_VERSION}" \ + --build-arg DEP_MAN_VERSION="%{DEP_MAN_VERSION}" \ + --build-arg go_version="%{go_version}" \ --tag %{COMPONENT}:%{IMAGE_TAG} \ %{_builddir}/%{RPM_NAME}-%{RPM_MAJOR_VERSION}/docker-build/%{COMPONENT}/ diff --git a/SPECS/caas-prometheus.spec b/SPECS/caas-prometheus.spec index ac1fa76..e5d86db 100644 --- a/SPECS/caas-prometheus.spec +++ b/SPECS/caas-prometheus.spec @@ -15,8 +15,8 @@ %define COMPONENT prometheus %define RPM_NAME caas-%{COMPONENT} %define RPM_MAJOR_VERSION 2.11.1 -%define RPM_MINOR_VERSION 0 -%define GO_VERSION 1.12.1 +%define RPM_MINOR_VERSION 1 +%define go_version 1.12.9 %define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION} Name: %{RPM_NAME} @@ -49,8 +49,8 @@ docker build \ --build-arg http_proxy="${http_proxy}" \ --build-arg https_proxy="${https_proxy}" \ --build-arg no_proxy="${no_proxy}" \ - --build-arg PROMETHEUS="%{RPM_MAJOR_VERSION}" \ - --build-arg GO_REQUIRED="%{GO_VERSION}" \ + --build-arg PROMETHEUS_VERSION="%{RPM_MAJOR_VERSION}" \ + --build-arg go_version="%{go_version}" \ --tag %{COMPONENT}:%{IMAGE_TAG} \ %{_builddir}/%{RPM_NAME}-%{RPM_MAJOR_VERSION}/docker-build/%{COMPONENT}/ diff --git a/docker-build/custom_metrics/Dockerfile b/docker-build/custom_metrics/Dockerfile index 093b950..902ab79 100644 --- a/docker-build/custom_metrics/Dockerfile +++ b/docker-build/custom_metrics/Dockerfile @@ -15,12 +15,17 @@ FROM alpine:3.9 MAINTAINER Szekeres Balazs -ARG CUSTOM_METRICS -ENV CUSTOM_METRICS_VERSION=$CUSTOM_METRICS +ARG CUSTOM_METRICS_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:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -RUN apk add --no-cache --virtual .build-deps build-base go godep curl tar git glide mercurial \ +RUN apk add --no-cache --virtual .build-deps build-base go godep curl tar git glide mercurial bash \ +&& 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 \ && mkdir -p ${GOPATH}/src/github.com/directxman12/k8s-prometheus-adapter \ && curl -fsSL -k https://github.com/DirectXMan12/k8s-prometheus-adapter/archive/v${CUSTOM_METRICS_VERSION}.tar.gz | tar zx --strip-components=1 -C ${GOPATH}/src/github.com/directxman12/k8s-prometheus-adapter \ && cd ${GOPATH}/src/github.com/directxman12/k8s-prometheus-adapter \ @@ -29,6 +34,7 @@ RUN apk add --no-cache --virtual .build-deps build-base go godep curl tar git gl && chmod +x /adapter \ && apk del .build-deps \ && rm -rf ${GOPATH} \ +&& rm -rf $go_install_dir \ && rm -rf /build \ && rm -rf /root/.glide diff --git a/docker-build/metrics_server/Dockerfile b/docker-build/metrics_server/Dockerfile index de7661e..7c012b5 100644 --- a/docker-build/metrics_server/Dockerfile +++ b/docker-build/metrics_server/Dockerfile @@ -15,17 +15,21 @@ FROM alpine:3.9 MAINTAINER Szekeres Balazs -ARG DEPENDENCY_MANAGER -ENV DEPENDENCY_VERSION=$DEPENDENCY_MANAGER -ARG METRICS_SERVER -ENV METRICS_SERVER_VERSION=$METRICS_SERVER +ARG DEP_MAN_VERSION +ARG METRICS_SERVER_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:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin ENV VERSION_LDFLAGS='-extldflags "-static"' -RUN apk add --no-cache --virtual .build-deps build-base go godep curl tar git bash mercurial \ -&& curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v${DEPENDENCY_VERSION}/dep-linux-amd64 \ +RUN apk add --no-cache --virtual .build-deps build-base go godep curl tar git bash mercurial bash \ +&& 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 ${GOPATH}/src/github.com/kubernetes-incubator/metrics-server/ \ && curl -fsSL -k https://github.com/kubernetes-incubator/metrics-server/archive/v${METRICS_SERVER_VERSION}.tar.gz | tar zx --strip-components=1 -C ${GOPATH}/src/github.com/kubernetes-incubator/metrics-server/ \ @@ -37,5 +41,6 @@ RUN apk add --no-cache --virtual .build-deps build-base go godep curl tar git ba && mv ./_output/amd64/metrics-server /metrics-server \ && apk del .build-deps \ && rm -rf ${GOPATH} \ +&& rm -rf $go_install_dir \ && rm -rf /build diff --git a/docker-build/prometheus/Dockerfile b/docker-build/prometheus/Dockerfile index cf831ab..22f0bb6 100644 --- a/docker-build/prometheus/Dockerfile +++ b/docker-build/prometheus/Dockerfile @@ -15,24 +15,16 @@ FROM alpine:3.9 MAINTAINER Szekeres Balazs -ARG GO_REQUIRED -ENV GO_REQUIRED_VERSION=$GO_REQUIRED -ARG PROMETHEUS -ENV PROMETHEUS_VERSION=$PROMETHEUS - ARG go_install_dir="/usr/local/go" - +ARG go_version +ARG PROMETHEUS_VERSION ENV PATH="$go_install_dir/bin:$PATH" -ENV GOROOT_BOOTSTRAP="$go_install_dir" -ENV USER=root RUN apk add --no-cache --virtual .build-deps build-base go godep curl tar git bash \ && mkdir -p $go_install_dir \ -\ -&& curl -fsSL -k https://dl.google.com/go/go${GO_REQUIRED_VERSION}.src.tar.gz | tar zx --strip-components=1 -C ${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 \ -\ && mkdir -p ${GOPATH}/src/github.com/prometheus/prometheus \ && curl -fsSL -k https://github.com/prometheus/prometheus/archive/v${PROMETHEUS_VERSION}.tar.gz | tar zx --strip-components=1 -C ${GOPATH}/src/github.com/prometheus/prometheus \ && cd ${GOPATH}/src/github.com/prometheus/prometheus \ @@ -42,6 +34,7 @@ RUN apk add --no-cache --virtual .build-deps build-base go godep curl tar git ba && apk del .build-deps \ && rm -rf /build \ && rm -rf ${GOPATH} \ +&& rm -rf $go_install_dir \ && apk add --no-cache nginx nginx-mod-stream supervisor \ && mkdir /var/run/supervisor/ \ && touch /run/nginx.pid /var/run/supervisor/supervisord.pid -- 2.16.6