-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.python
37 lines (33 loc) · 1.42 KB
/
Dockerfile.python
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
FROM jutgeorg/cpp:latest
USER root
SHELL ["/bin/bash", "-c"]
RUN apt-get --yes --no-install-recommends install zlib1g-dev
RUN pip3 install --break-system-packages turtle-pil easyinput yogi pytokr mypy pycodestyle
# Codon (as root)
ADD https://exaloop.io/install.sh /root/install-codon.sh
# FIXME: Why install-codon.sh does not return 0?
RUN bash /root/install-codon.sh || true
RUN mv /root/.codon /opt/codon && \
ln -s /opt/codon/bin/codon /usr/local/bin/codon
# Install Python libraries (as user worker!)
USER worker
RUN mkdir /opt/pylibs && \
cd /opt/pylibs && \
for pylib in numpy scipy simpy networkx optilog pandas matplotlib more-itertools biopython beautifulsoup4; do \
echo install $pylib; \
python3 -m venv $pylib; \
source $pylib/bin/activate; \
pip install $pylib --break-system-packages; \
pip show $pylib > $pylib/show.txt; \
deactivate; \
chmod 700 $pylib; \
done
RUN pip3 cache purge
USER root
# If the following fails, perhaps python has updated, and the Dockerfile instructions must be updated to follow that.
# Essentially, this line is a canary.
RUN ls -lh /usr/local/lib/python3.11/
RUN true && for pylib in numpy scipy simpy networkx optilog pandas matplotlib more-itertools biopython beautifulsoup4; do \
ln -s /opt/pylibs/$pylib/lib/python3.11/site-packages/pip /usr/local/lib/python3.11/dist-packages/$pylib; \
done
USER worker