1
1
FROM theiaide/theia-python:latest
2
2
3
- COPY requirements.txt /tmp
3
+ ENV DEBIAN_FRONTEND noninteractive
4
4
5
- # # User account
6
- RUN adduser --disabled-password --gecos '' theia && \
7
- adduser theia sudo && \
8
- echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
9
- chown -R theia:theia /home/theia
5
+ COPY requirements.txt /tmp
10
6
11
7
RUN apt-get update \
12
- && apt-get install -y vim yarn \
8
+ && apt-get install -y vim yarn sudo \
13
9
&& apt-get install -y make build-essential libssl-dev zlib1g-dev \
14
10
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \
15
11
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl git \
@@ -18,14 +14,19 @@ RUN apt-get update \
18
14
&& rm -rf /var/cache/apt/* \
19
15
&& rm -rf /var/lib/apt/lists/*
20
16
17
+ # # User account
18
+ RUN adduser --disabled-password --gecos '' theia && \
19
+ adduser theia sudo && \
20
+ echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
21
+ chown -R theia:theia /home/theia
22
+
23
+
21
24
USER theia
22
25
WORKDIR /home/theia
23
26
24
27
# Python2 and Python3 are installed by parent Dockerfile:
25
28
# https://github.com/theia-ide/theia-apps/blob/master/theiaide/theia-python/Dockerfile
26
-
27
- # Save the preinstalled python paths - do this before setting up pyenv because pyenv may report
28
- # different binaries with which.
29
+ # Here we save the preinstalled python paths because we need to use them later.
29
30
30
31
RUN which python > ~/python2_path
31
32
RUN which python3 > ~/python3_path
@@ -52,19 +53,17 @@ RUN export PATH=/home/theia/.pyenv/bin:$PATH; \
52
53
&& pyenv local $(pyenv versions --bare) \
53
54
&& pyenv versions
54
55
55
- # RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
56
- # && sudo python get-pip.py
57
56
58
57
USER root
59
58
60
59
RUN echo "Installing python modules" \
61
60
&& PY_PATHS=$(ls -1 /home/theia/.pyenv/versions/*/bin/python?.? && cat /home/theia/python3_path && cat /home/theia/python2_path) \
62
- && PY_PATHS=$(cat /home/theia/python3_path && cat /home/theia/python2_path) \
63
- && for v in ${PY_PATHS}; do ${v} -m pip install --upgrade pip setuptools wheel; done \
64
- && for v in ${PY_PATHS}; do ${v} -m pip install --upgrade tox tox-pyenv ipython pylint pytest mock nose flake8 flake8-docstrings autopep8; done \
65
- && /home/theia/.pyenv/versions/*/bin/python3.8 -m pip install -U black isort python-language-server sphinx\
61
+ && for v in ${PY_PATHS}; do echo "******* ${v} *******" ; ${v} -m pip install --upgrade pip setuptools wheel; done \
62
+ && for v in ${PY_PATHS}; do echo "******* ${v} *******" ; ${v} -m pip install --upgrade tox tox-pyenv ipython pylint pytest mock nose flake8 flake8-docstrings autopep8; done \
63
+ && /home/theia/.pyenv/versions/*/bin/python3.8 -m pip install -U black isort sphinx \
66
64
&& ln -f -s /home/theia/.pyenv/versions/*/bin/black /bin/ \
67
65
&& ln -f -s /home/theia/.pyenv/versions/*/bin/isort /bin/ \
66
+ && ln -f -s /home/theia/.pyenv/versions/*/bin/sphinx /bin/ \
68
67
&& for v in ${PY_PATHS}; do ${v} -m pip install -r /tmp/requirements.txt; done
69
68
70
69
RUN chown -R theia:theia /home/theia
0 commit comments