From 4813836b226f3b4c2a2a11a1dffa35cfb1c05aa1 Mon Sep 17 00:00:00 2001 From: Balazs Szekeres Date: Fri, 30 Aug 2019 16:24:53 +0200 Subject: [PATCH] Go version updated to 1.12.9 Change-Id: I679dca49f291e48bdf0a0e466264c971f8d05681 Signed-off-by: Balazs Szekeres --- SPECS/registry.spec | 5 ++++- docker-build/registry/Dockerfile | 16 ++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/SPECS/registry.spec b/SPECS/registry.spec index 94f68b5..2a084de 100644 --- a/SPECS/registry.spec +++ b/SPECS/registry.spec @@ -15,8 +15,10 @@ %define COMPONENT registry %define RPM_NAME caas-%{COMPONENT} %define RPM_MAJOR_VERSION 2.7.1 -%define RPM_MINOR_VERSION 6 +%define RPM_MINOR_VERSION 7 %define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION} +%define go_version 1.12.9 + Name: %{RPM_NAME} Version: %{RPM_MAJOR_VERSION} Release: %{RPM_MINOR_VERSION}%{?dist} @@ -50,6 +52,7 @@ docker build \ --build-arg https_proxy="${https_proxy}" \ --build-arg no_proxy="${no_proxy}" \ --build-arg REGISTRY="%{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/registry/Dockerfile b/docker-build/registry/Dockerfile index 80cc4dc..090f6c7 100644 --- a/docker-build/registry/Dockerfile +++ b/docker-build/registry/Dockerfile @@ -17,25 +17,33 @@ MAINTAINER Balint Varga ARG REGISTRY ENV REGISTRY_VERSION=$REGISTRY +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 DOCKER_BUILDTAGS include_oss include_gcs -WORKDIR ${GOPATH}/src/github.com/docker/distribution COPY common_scripts/wait-for-files /usr/bin/ COPY mainstart.sh / RUN adduser -u 149 -D -H -s /sbin/nologin dockerreg \ && chmod +x /mainstart.sh /usr/bin/wait-for-files \ \ -&& apk add --no-cache --virtual .build-deps build-base go godep git curl tar \ -&& curl -fsSL -k https://github.com/docker/distribution/archive/v${REGISTRY_VERSION}.tar.gz | tar zx --strip-components=1 \ +&& apk add --no-cache --virtual .build-deps build-base go godep git curl tar 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/docker/distribution \ +&& curl -fsSL -k https://github.com/docker/distribution/archive/v${REGISTRY_VERSION}.tar.gz | tar zx --strip-components=1 -C ${GOPATH}/src/github.com/docker/distribution \ +&& cd ${GOPATH}/src/github.com/docker/distribution \ && go get -d -v \ && make PREFIX=/build clean binaries \ && mv ${GOPATH}/src/github.com/docker/distribution/bin/registry /usr/bin/ \ \ && apk del .build-deps \ +&& rm -rf $go_install_dir \ && rm -rf /build WORKDIR / -- 2.16.6