MilesCranmer commited on
Commit
dc5faa1
1 Parent(s): 5ab3eb4

Clean up pyenv install

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -7
Dockerfile CHANGED
@@ -24,15 +24,18 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y \
24
  WORKDIR /pysr
25
 
26
  # Install PyEnv to switch Python to dynamically linked version:
27
- RUN curl https://pyenv.run | bash
28
- ENV PATH="/root/.pyenv/bin:$PATH"
29
-
30
- # ENV PYVERSION=${PYVERSION}
31
- RUN PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install ${PYVERSION}
32
- ENV PATH="/root/.pyenv/versions/$PYVERSION/bin:$PATH"
 
 
 
33
 
34
  # Install IPython and other useful libraries:
35
- RUN pip install ipython jupyter matplotlib
36
 
37
  # Caches install (https://stackoverflow.com/questions/25305788/how-to-avoid-reinstalling-packages-when-building-docker-image-for-python-project)
38
  ADD ./requirements.txt /pysr/requirements.txt
 
24
  WORKDIR /pysr
25
 
26
  # Install PyEnv to switch Python to dynamically linked version:
27
+ ENV PYVERSION ${PYVERSION}
28
+ ENV PYENV_ROOT /root/.pyenv
29
+ ENV PATH "${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:$PATH"
30
+ RUN set -ex \
31
+ && curl https://pyenv.run | bash \
32
+ && pyenv update \
33
+ && PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install ${PYVERSION} \
34
+ && pyenv global ${PYVERSION} \
35
+ && pyenv rehash
36
 
37
  # Install IPython and other useful libraries:
38
+ RUN pip install ipython matplotlib
39
 
40
  # Caches install (https://stackoverflow.com/questions/25305788/how-to-avoid-reinstalling-packages-when-building-docker-image-for-python-project)
41
  ADD ./requirements.txt /pysr/requirements.txt