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 <jose.lausuch@ericsson.com>
MAINTAINER Jose Lausuch <jose.lausuch@ericsson.com>
LABEL version="0.1" description="OPNFV Storperf Docker container"
+ARG BRANCH=master
+
ENV repos_dir /home/opnfv/repos
WORKDIR /home/opnfv
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