X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=docker-build%2Fcpupooler%2FDockerfile;h=8267df1c0804399202fbc94aba5c024c45d51024;hb=1c00762f8f3a78c0d6bd5ca177018effdbe10ca3;hp=52e3a26a8f49cdcee878d862d73e309e9a49aae9;hpb=491cc9200405931de807234cb0dc299bff76e3ea;p=ta%2Fcaas-cpupooler.git diff --git a/docker-build/cpupooler/Dockerfile b/docker-build/cpupooler/Dockerfile index 52e3a26..8267df1 100644 --- a/docker-build/cpupooler/Dockerfile +++ b/docker-build/cpupooler/Dockerfile @@ -15,21 +15,26 @@ FROM alpine:3.9 MAINTAINER Balazs Szekeres -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 curl \ -&& curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 \ +&& apk add --no-cache --virtual .build-deps build-base git mercurial go glide bash tar \ +&& apk add --no-cache curl \ +&& 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/Levovar/CPU-Pooler.git $BUILD_DIR \ +&& git clone https://github.com/nokia/CPU-Pooler.git $BUILD_DIR \ && cd $BUILD_DIR \ && git fetch --tags \ && git checkout ${CPUPOOLER_VERSION} \ @@ -45,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