%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}
--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}/
%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}
--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}/
%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}
--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}/
FROM alpine:3.9
MAINTAINER Szekeres Balazs <balazs.szekeres@nokia.com>
-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 \
&& chmod +x /adapter \
&& apk del .build-deps \
&& rm -rf ${GOPATH} \
+&& rm -rf $go_install_dir \
&& rm -rf /build \
&& rm -rf /root/.glide
FROM alpine:3.9
MAINTAINER Szekeres Balazs <balazs.szekeres@nokia.com>
-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/ \
&& mv ./_output/amd64/metrics-server /metrics-server \
&& apk del .build-deps \
&& rm -rf ${GOPATH} \
+&& rm -rf $go_install_dir \
&& rm -rf /build
FROM alpine:3.9
MAINTAINER Szekeres Balazs <balazs.szekeres@nokia.com>
-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 \
&& 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