From: Levente Kálé Date: Fri, 6 Sep 2019 11:04:55 +0000 (+0000) Subject: Merge "Go version updated to 1.12.9" X-Git-Url: https://gerrit.akraino.org/r/gitweb?p=ta%2Fcaas-registry.git;a=commitdiff_plain;h=3a07e29dbc786524acc028e048e4ec3c3bfa0299;hp=df5313af0a7d51ef8c1ed08b3b2fb01a30b67f47 Merge "Go version updated to 1.12.9" --- 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 /