diff options
author | zhihui wu <wu.zhihui1@zte.com.cn> | 2017-08-09 17:25:07 +0800 |
---|---|---|
committer | zhihui wu <wu.zhihui1@zte.com.cn> | 2017-08-10 16:39:07 +0800 |
commit | bad7263eca7dd3fead2ae222729b7452a50a236b (patch) | |
tree | 28cf9a94d094557beceb8e2a9b5cb96dbc21f1b4 | |
parent | 8c1e9c553cc6b4b8b78c31e7f5f48836c0d945e1 (diff) |
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 <wu.zhihui1@zte.com.cn>
-rw-r--r-- | docker/Dockerfile | 37 |
1 files changed, 17 insertions, 20 deletions
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 |