Skip to content

Commit

Permalink
Unite python pip installation in one layer
Browse files Browse the repository at this point in the history
  • Loading branch information
bebehei committed Feb 22, 2019
1 parent 88ba5cc commit 51aa7d0
Showing 1 changed file with 22 additions and 24 deletions.
46 changes: 22 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -138,30 +138,28 @@ ENV PYENV_ROOT=/home/docs/.pyenv \
PATH=/home/docs/.pyenv/shims:$PATH:/home/docs/.pyenv/bin

# Install supported Python versions
RUN pyenv install $PYTHON_VERSION_27 && \
pyenv install $PYTHON_VERSION_37 && \
pyenv install $PYTHON_VERSION_36 && \
pyenv global \
$PYTHON_VERSION_27 \
$PYTHON_VERSION_37 \
$PYTHON_VERSION_36

WORKDIR /tmp

RUN pyenv local $PYTHON_VERSION_27 && \
pyenv exec pip install --no-cache-dir -U pip && \
pyenv exec pip install --no-cache-dir --only-binary numpy,scipy numpy scipy && \
pyenv exec pip install --no-cache-dir pandas matplotlib virtualenv

RUN pyenv local $PYTHON_VERSION_37 && \
pyenv exec pip install --no-cache-dir -U pip && \
pyenv exec pip install --no-cache-dir --only-binary numpy,scipy numpy scipy && \
pyenv exec pip install --no-cache-dir pandas matplotlib virtualenv

RUN pyenv local $PYTHON_VERSION_36 && \
pyenv exec pip install --no-cache-dir -U pip && \
pyenv exec pip install --no-cache-dir --only-binary numpy,scipy numpy scipy && \
pyenv exec pip install --no-cache-dir pandas matplotlib virtualenv
RUN set -x \
&& pyenv install $PYTHON_VERSION_27 \
&& pyenv install $PYTHON_VERSION_37 \
&& pyenv install $PYTHON_VERSION_36 \
&& pyenv global \
$PYTHON_VERSION_27 \
$PYTHON_VERSION_37 \
$PYTHON_VERSION_36 \
&& true

RUN set -x \
&& cd /tmp \
&& for env in "${PYTHON_VERSION_27}" "${PYTHON_VERSION_37}" "${PYTHON_VERSION_36}"; \
do pyenv local "${env}" \
&& pyenv exec pip install --no-cache-dir -U pip \
&& pyenv exec pip install --no-cache-dir --only-binary numpy,scipy \
matplotlib \
numpy \
pandas \
scipy \
virtualenv \
; done

WORKDIR /

Expand Down

0 comments on commit 51aa7d0

Please sign in to comment.