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 38
|
ARG BASE_IMAGE=trame-common
FROM ${BASE_IMAGE}
ARG PYTHON_VERSION=3.9
RUN apt-get update && \
apt-get install -y \
python${PYTHON_VERSION} \
# python-distutils is required to install pip
python${PYTHON_VERSION}-distutils \
# python-is-python3 creates a symlink for python to python3
python-is-python3 \
# For creating virtual environments
python${PYTHON_VERSION}-venv && \
rm -rf /var/lib/apt/lists/*
# Set python3 to python3.x (otherwise, it will be python3.8)
RUN if [ "$PYTHON_VERSION" != "3" ] ; then update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1 ;fi
# Never use a cache directory for pip, both here in this Dockerfile
# and when we run the container.
ENV PIP_NO_CACHE_DIR=1
# Install and upgrade pip
RUN wget -q -O- https://bootstrap.pypa.io/get-pip.py | python${PYTHON_VERSION} && \
pip install -U pip
# Install setup dependencies
RUN pip install PyYAML wheel
# Copy the pip scripts into place
COPY scripts/pip/* /opt/trame/
# Set venv paths
ENV TRAME_VENV=/deploy/server/venv
ENV PV_VENV=$TRAME_VENV
ENV VTK_VENV=$TRAME_VENV
ENV TRAME_PYTHON=${PYTHON_VERSION}
|