Spaces:
Running
Running
MilesCranmer
commited on
Commit
•
2deb5fc
1
Parent(s):
704d0c6
Base image on python rather than julia
Browse files- Dockerfile +18 -22
Dockerfile
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
# This builds a dockerfile containing a working copy of PySR
|
2 |
# with all pre-requisites installed.
|
3 |
|
4 |
-
ARG
|
5 |
|
6 |
-
FROM
|
7 |
|
8 |
# metainformation
|
9 |
LABEL org.opencontainers.image.authors = "Miles Cranmer"
|
@@ -11,32 +11,28 @@ LABEL org.opencontainers.image.source = "https://github.com/MilesCranmer/PySR"
|
|
11 |
LABEL org.opencontainers.image.licenses = "Apache License 2.0"
|
12 |
|
13 |
# Need to use ARG after FROM, otherwise it won't get passed through.
|
14 |
-
ARG
|
15 |
|
16 |
-
RUN apt-get update && apt-get
|
17 |
-
make build-essential libssl-dev zlib1g-dev \
|
18 |
-
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
|
19 |
-
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev \
|
20 |
-
vim git tmux \
|
21 |
-
&& apt-get clean \
|
22 |
-
&& rm -rf /var/lib/apt/lists/*
|
23 |
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
-
|
27 |
-
ENV
|
28 |
-
|
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
|
42 |
RUN pip3 install -r /pysr/requirements.txt
|
@@ -53,4 +49,4 @@ LABEL org.opencontainers.image.version = $(python -c "import pysr; print(pysr.__
|
|
53 |
# Install Julia pre-requisites:
|
54 |
RUN python3 -c 'import pysr; pysr.install()'
|
55 |
|
56 |
-
CMD ["
|
|
|
1 |
# This builds a dockerfile containing a working copy of PySR
|
2 |
# with all pre-requisites installed.
|
3 |
|
4 |
+
ARG PYVERSION=3.10.8
|
5 |
|
6 |
+
FROM python:$PYVERSION
|
7 |
|
8 |
# metainformation
|
9 |
LABEL org.opencontainers.image.authors = "Miles Cranmer"
|
|
|
11 |
LABEL org.opencontainers.image.licenses = "Apache License 2.0"
|
12 |
|
13 |
# Need to use ARG after FROM, otherwise it won't get passed through.
|
14 |
+
ARG JLVERSION=1.8.2
|
15 |
|
16 |
+
RUN apt-get update && apt-get install -y expect && apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
+
# Install juliaup:
|
19 |
+
RUN curl -fsSL https://install.julialang.org -o /tmp/install-julia.sh && \
|
20 |
+
echo '#!/usr/bin/expect\nspawn /tmp/install-julia.sh\nexpect "Cancel installation"\nsend -- "\\r"\nexpect eof' >> /tmp/install-julia.exp && \
|
21 |
+
chmod +x /tmp/install-julia.sh && \
|
22 |
+
chmod +x /tmp/install-julia.exp && \
|
23 |
+
/tmp/install-julia.exp && \
|
24 |
+
rm /tmp/install-julia.sh && \
|
25 |
+
rm /tmp/install-julia.exp
|
26 |
|
27 |
+
ENV JULIAUP_ROOT /root/.julia/juliaup
|
28 |
+
ENV PATH "${JULIAUP_ROOT}/bin:${PATH}"
|
29 |
+
RUN juliaup add $JLVERSION && juliaup default $JLVERSION && juliaup update
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
# Install IPython and other useful libraries:
|
32 |
RUN pip install ipython matplotlib
|
33 |
|
34 |
+
WORKDIR /pysr
|
35 |
+
|
36 |
# Caches install (https://stackoverflow.com/questions/25305788/how-to-avoid-reinstalling-packages-when-building-docker-image-for-python-project)
|
37 |
ADD ./requirements.txt /pysr/requirements.txt
|
38 |
RUN pip3 install -r /pysr/requirements.txt
|
|
|
49 |
# Install Julia pre-requisites:
|
50 |
RUN python3 -c 'import pysr; pysr.install()'
|
51 |
|
52 |
+
CMD ["ipython"]
|