From bad7263eca7dd3fead2ae222729b7452a50a236b Mon Sep 17 00:00:00 2001 From: zhihui wu Date: Wed, 9 Aug 2017 17:25:07 +0800 Subject: Optimize Dockerfile - Add new packages what storperf scripts need : curl and wget - Minimize the number of layers - ansible is already in requirements.txt, delete the apt-get commands Change-Id: Ie04d6618737146674396a7c005a247829f06c1d9 Signed-off-by: zhihui wu --- docker/Dockerfile | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) (limited to 'docker') diff --git a/docker/Dockerfile b/docker/Dockerfile index bab503fc..8109fb69 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -8,11 +8,17 @@ LABEL version="0.1" description="OPNFV QTIP Docker container" ARG BRANCH=master -ENV REPOS_DIR /home/opnfv/repos -ENV PYTHONPATH /home/opnfv/repos/qtip -ENV USER root +ENV REPOS_DIR=/home/opnfv/repos \ + PYTHONPATH=/home/opnfv/repos/qtip \ + USER=root + WORKDIR /home/opnfv +RUN mkdir -p ${REPOS_DIR} \ + && mkdir -p /root/qtip/logs \ + && mkdir -p /root/.ssh \ + && chmod 700 /root/.ssh + # Packaged Dependencies RUN apt-get update && apt-get install -y \ software-properties-common \ @@ -28,26 +34,18 @@ RUN apt-get update && apt-get install -y \ python-setuptools \ rsync \ iputils-ping \ + wget \ + curl \ --no-install-recommends \ -&& rm -rf /var/lib/apt/lists/* + && rm -rf /var/lib/apt/lists/* RUN pip install -U pip && pip install -U setuptools -RUN apt-add-repository ppa:ansible/ansible -y -RUN apt-key update -y -RUN apt-get update && apt-get install ansible -y - -RUN mkdir -p ${REPOS_DIR} -RUN mkdir -p /root/.ssh -RUN mkdir -p /root/qtip/logs - -RUN chmod 700 /root/.ssh - #Cloning Repos -RUN git config --global http.sslVerify false -RUN git clone -b $BRANCH https://gerrit.opnfv.org/gerrit/qtip $REPOS_DIR/qtip - -RUN cd $REPOS_DIR/qtip && pip install -U -e . +RUN git config --global http.sslVerify false \ + && git clone -b $BRANCH https://gerrit.opnfv.org/gerrit/qtip $REPOS_DIR/qtip \ + && cd $REPOS_DIR/qtip \ + && pip install -U -e . RUN echo 'eval $(ssh-agent)' >> /root/.bashrc @@ -55,8 +53,7 @@ RUN echo 'eval $(ssh-agent)' >> /root/.bashrc EXPOSE 5000 #Config supervisor -RUN mkdir -p /var/log/supervisor -RUN locale-gen en_US en_US.UTF-8 +RUN mkdir -p /var/log/supervisor && locale-gen en_US en_US.UTF-8 COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf CMD ["/usr/bin/supervisord"] \ No newline at end of file -- cgit 1.2.3-korg