From b20e463faa9990a2bdfe13683f7fb76d32e2fd65 Mon Sep 17 00:00:00 2001 From: "jose.lausuch" Date: Wed, 30 Nov 2016 15:49:47 +0100 Subject: Add BRANCH Argument in the Dockerfile This patch allows: - clone the respective repo branch while building the image - slightly reduce the size of the image by cloning only the latest Change-Id: I48994d7d9cf230493fa22f39cf1ed7ef4fd72d9e Signed-off-by: jose.lausuch --- docker/Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index fb25bfc..449ad70 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -23,6 +23,8 @@ FROM ubuntu:14.04 MAINTAINER Jose Lausuch LABEL version="0.1" description="OPNFV Storperf Docker container" +ARG BRANCH=master + ENV repos_dir /home/opnfv/repos WORKDIR /home/opnfv @@ -62,8 +64,8 @@ RUN mkdir -p /root/.ssh RUN chmod 700 /root/.ssh RUN git config --global http.sslVerify false -RUN git clone https://gerrit.opnfv.org/gerrit/storperf ${repos_dir}/storperf -RUN git clone https://gerrit.opnfv.org/gerrit/releng ${repos_dir}/releng +RUN git --depth 1 -b $BRANCH clone https://gerrit.opnfv.org/gerrit/storperf ${repos_dir}/storperf +RUN git --depth 1 clone https://gerrit.opnfv.org/gerrit/releng ${repos_dir}/releng # Third party git fetches RUN git clone https://github.com/swagger-api/swagger-ui.git ${repos_dir}/swagger-ui -- cgit 1.2.3-korg