2021-01-22 17:32:12 +01:00
|
|
|
# Get the base Python image
|
2022-10-27 16:06:51 +02:00
|
|
|
FROM alpine:edge AS builder
|
|
|
|
|
|
|
|
# Variables
|
|
|
|
ARG branch="devel"
|
|
|
|
ARG login="" password=""
|
|
|
|
ARG folder=/opt/msspec user=msspec
|
2021-01-22 17:32:12 +01:00
|
|
|
|
2021-09-17 11:55:23 +02:00
|
|
|
# Install system dependencies
|
2022-10-27 16:06:51 +02:00
|
|
|
# tools
|
2023-12-01 10:17:09 +01:00
|
|
|
RUN apk add bash git make gfortran python3 py3-numpy-f2py
|
2022-10-27 16:06:51 +02:00
|
|
|
# headers
|
2023-12-01 10:17:09 +01:00
|
|
|
RUN apk add python3-dev lapack-dev musl-dev hdf5-dev cairo-dev
|
2022-10-27 16:06:51 +02:00
|
|
|
# python packages
|
2023-12-01 10:17:09 +01:00
|
|
|
RUN apk add py3-virtualenv py3-pip py3-numpy-dev py3-h5py py3-lxml py3-matplotlib \
|
|
|
|
py3-numpy py3-pandas py3-cairo py3-scipy py3-setuptools_scm \
|
|
|
|
py3-terminaltables ipython
|
|
|
|
RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/community py3-wxpython
|
|
|
|
#RUN pip install ase pint terminaltables ipython
|
2022-10-27 16:06:51 +02:00
|
|
|
# for GUI
|
|
|
|
RUN apk add ttf-droid adwaita-icon-theme
|
|
|
|
RUN apk add build-base
|
|
|
|
|
|
|
|
# Fetch the code
|
|
|
|
RUN mkdir -p ${folder}/code
|
|
|
|
WORKDIR ${folder}/code
|
|
|
|
RUN git clone --branch ${branch} https://${login}:${password}@git.ipr.univ-rennes1.fr/epsi/msspec_python3.git .
|
|
|
|
|
2023-12-01 10:17:09 +01:00
|
|
|
RUN virtualenv --system-site-packages ${folder}/.local/src/msspec_venv
|
|
|
|
RUN make pybinding PYTHON=python3 VENV_PATH=${folder}/.local/src/msspec_venv VERBOSE=1
|
|
|
|
RUN make -C src sdist PYTHON=python3 VENV_PATH=${folder}/.local/src/msspec_venv VERBOSE=1
|
|
|
|
RUN make -C src frontend PYTHON=python3 VENV_PATH=${folder}/.local/src/msspec_venv VERBOSE=1
|
|
|
|
RUN source ${folder}/.local/src/msspec_venv/bin/activate && pip install src/dist/msspec*tar.gz
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-27 16:06:51 +02:00
|
|
|
# Build
|
2023-12-01 10:17:09 +01:00
|
|
|
#RUN make pybinding NO_VENV=1 PYTHON=python3 VERBOSE=1
|
|
|
|
#RUN make -C src sdist PYTHON=python3 NO_VENV=1 VENV_PATH=${folder}/.local/src/msspec_venv
|
|
|
|
#&& \
|
|
|
|
# pip install src/dist/msspec*tar.gz
|
2021-09-17 11:55:23 +02:00
|
|
|
|
|
|
|
# Add a non-privileged user
|
2023-12-01 10:17:09 +01:00
|
|
|
#RUN adduser -D -s /bin/bash -h ${folder} ${user}
|
2021-09-17 11:55:23 +02:00
|
|
|
|
2021-01-22 17:32:12 +01:00
|
|
|
# Set the working directory in the container
|
2023-12-01 10:17:09 +01:00
|
|
|
#USER ${user}
|
2022-10-27 16:06:51 +02:00
|
|
|
|
2023-12-01 10:17:09 +01:00
|
|
|
#RUN virtualenv --system-site-packages ${folder}/.local/src/msspec_venv
|
|
|
|
#RUN source ${folder}/.local/src/msspec_venv/bin/activate && pip install src/dist/msspec*.tar.gz
|
|
|
|
#RUN make -C src frontend PYTHON=python3 NO_VENV=1 VENV_PATH=${folder}/.local/src/msspec_venv
|
2021-01-22 17:32:12 +01:00
|
|
|
|
|
|
|
|
2022-10-27 16:06:51 +02:00
|
|
|
|
|
|
|
FROM alpine:edge
|
|
|
|
# Variables
|
|
|
|
ARG folder=/opt/msspec user=msspec
|
|
|
|
# Install system dependencies
|
2023-12-01 10:17:09 +01:00
|
|
|
RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/community \
|
2022-10-27 16:06:51 +02:00
|
|
|
# hdf5-hl cairo openblas lapack libxml2 libxslt libzlf wxwidgets-gtk3 openjpeg libimagequant \
|
|
|
|
nano \
|
|
|
|
py3-virtualenv \
|
|
|
|
lapack \
|
|
|
|
bash \
|
|
|
|
# git \
|
|
|
|
# make \
|
|
|
|
# gfortran \
|
|
|
|
python3 \
|
|
|
|
# ttf-droid \
|
|
|
|
ttf-liberation \
|
|
|
|
adwaita-xfce-icon-theme \
|
|
|
|
# python3-dev \
|
|
|
|
# lapack-dev \
|
|
|
|
# musl-dev \
|
|
|
|
# py3-virtualenv \
|
|
|
|
py3-pip \
|
|
|
|
# py3-numpy-dev \
|
|
|
|
py3-h5py \
|
|
|
|
py3-lxml \
|
|
|
|
py3-matplotlib \
|
|
|
|
py3-numpy \
|
|
|
|
py3-pandas \
|
|
|
|
py3-cairo \
|
|
|
|
py3-scipy \
|
|
|
|
py3-setuptools_scm \
|
|
|
|
py3-wxpython \
|
2023-12-01 10:17:09 +01:00
|
|
|
py3-terminaltables \
|
|
|
|
py3-bayesian-optimization \
|
2022-10-27 16:06:51 +02:00
|
|
|
# Add a non-privileged user
|
|
|
|
&& adduser -D -s /bin/bash -h ${folder} ${user}
|
|
|
|
|
|
|
|
# Set the working directory in the container
|
|
|
|
USER ${user}
|
|
|
|
WORKDIR ${folder}
|
2021-01-22 17:32:12 +01:00
|
|
|
# Install msspec
|
2022-10-27 16:06:51 +02:00
|
|
|
#COPY --from=builder ${folder}/.local ${folder}/.local
|
|
|
|
#COPY --from=builder /usr/lib/python3.10/site-packages /usr/lib/python3.10/site-packages
|
|
|
|
|
|
|
|
COPY --from=builder ${folder}/code/src/dist/msspec*tar.gz msspec.tar.gz
|
|
|
|
RUN virtualenv --system-site-packages .local/src/msspec_venv && \
|
|
|
|
. .local/src/msspec_venv/bin/activate && \
|
|
|
|
pip install msspec.tar.gz && \
|
2023-12-01 10:17:09 +01:00
|
|
|
pip install ipython && \
|
|
|
|
pip cache purge && \
|
2022-10-27 16:06:51 +02:00
|
|
|
rm -f msspec.tar.gz && \
|
|
|
|
mkdir -p .local/bin
|
|
|
|
|
2023-12-01 10:17:09 +01:00
|
|
|
COPY --from=builder /root/.local/bin/msspec .local/bin/msspec
|
2022-10-27 16:06:51 +02:00
|
|
|
ENV PATH=${folder}/.local/bin:$PATH
|
2021-01-22 17:32:12 +01:00
|
|
|
|
2021-06-27 21:42:22 +02:00
|
|
|
# Run the msspec frontend command on startup
|
2021-09-17 11:55:23 +02:00
|
|
|
ENTRYPOINT ["msspec"]
|