aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhelenyao <yaohelan@huawei.com>2016-12-05 02:31:36 -0500
committerhelenyao <yaohelan@huawei.com>2016-12-05 03:35:50 -0500
commita9a8f6e6a042c45f3d37000278bbb53b4bd067ad (patch)
treef078e8fff2bb86b54bb1ea4008e86cc9d07bb68c
parentdc733c31177b0ffdc4c30b9c4801b765909f1c50 (diff)
Concatenate the RUN commands
JIRA: FUNCTEST-636 Whenever running RUN command, a new image layer is created. It would be recommended to group commands into groups to decrease layers. Change-Id: Iae9287b2a7fd11705b5f25807fab652afa0ccb74 Signed-off-by: helenyao <yaohelan@huawei.com>
-rw-r--r--docker/Dockerfile29
1 files changed, 15 insertions, 14 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile
index dc772c5b..cb2752ba 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -52,7 +52,6 @@ ENV creds ${FUNCTEST_CONF_DIR}/openstack.creds
ENV TERM xterm
ENV COLORTERM gnome-terminal
-
WORKDIR ${HOME}
# Packaged dependencies
@@ -81,11 +80,11 @@ ruby1.9.1-dev \
RUN pip install --upgrade pip
-RUN mkdir -p ${REPOS_DIR}
-RUN mkdir -p ${FUNCTEST_BASE_DIR}/results
-RUN mkdir -p ${FUNCTEST_BASE_DIR}/conf
-RUN mkdir -p /root/.ssh
-RUN chmod 700 /root/.ssh
+RUN mkdir -p ${REPOS_DIR} \
+ && mkdir -p ${FUNCTEST_BASE_DIR}/results \
+ && mkdir -p ${FUNCTEST_BASE_DIR}/conf \
+ && mkdir -p /root/.ssh \
+ && chmod 700 /root/.ssh
RUN git config --global http.sslVerify false
@@ -114,14 +113,16 @@ RUN git clone --depth 1 -b $ODL_TAG https://git.opendaylight.org/gerrit/p/integr
RUN git clone --depth 1 -b $VIMS_TAG https://github.com/boucherv-orange/clearwater-live-test ${REPOS_DIR}/vims-test
RUN git clone --depth 1 https://github.com/wuwenbin2/OnosSystemTest.git ${REPOS_DIR}/onos
-RUN pip install -r ${FUNCTEST_REPO_DIR}/requirements.txt
-RUN cd ${FUNCTEST_REPO_DIR} && pip install .
+RUN cd ${FUNCTEST_REPO_DIR} \
+ && pip install -r requirements.txt \
+ && pip install .
+
RUN pip install -r ${REPOS_DIR}/rally/requirements.txt
RUN pip install -r ${REPOS_DIR}/tempest/requirements.txt
RUN find ${FUNCTEST_REPO_DIR} -name "*.py" \
- -not -path *unit_tests* |xargs grep __main__ |cut -d\: -f 1 |xargs chmod -c 755
-RUN find ${FUNCTEST_REPO_DIR} -name "*.sh" |xargs grep \#\! |cut -d\: -f 1 |xargs chmod -c 755
+ -not -path *unit_tests* |xargs grep __main__ |cut -d\: -f 1 |xargs chmod -c 755 \
+ && find ${FUNCTEST_REPO_DIR} -name "*.sh" |xargs grep \#\! |cut -d\: -f 1 |xargs chmod -c 755
RUN /bin/bash ${REPOS_DIR}/parser/tests/parser_install.sh ${REPOS_DIR}
RUN ${REPOS_DIR}/rally/install_rally.sh --yes
@@ -155,10 +156,10 @@ RUN /bin/bash -c ". /etc/profile.d/rvm.sh \
&& cd ${REPOS_DIR}/vims-test \
&& bundle install"
-RUN sh -c 'curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -'
-RUN sudo apt-get install -y nodejs
-RUN cd ${REPOS_DIR}/promise && sudo npm -g install npm@latest
-RUN cd ${REPOS_DIR}/promise/source && npm install
+RUN sh -c 'curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -' \
+ && sudo apt-get install -y nodejs \
+ && cd ${REPOS_DIR}/promise && sudo npm -g install npm@latest \
+ && cd ${REPOS_DIR}/promise/source && npm install
RUN echo "set nocompatible \n\
set backspace=2" \