Skip to content

Commit ca6af60

Browse files
committed
1 parent 7d3c21e commit ca6af60

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

rocker-rpy/Dockerfile

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ FROM ghcr.io/geocompx/minimal
55
# - python3-dev: Headers needed to compile certain Python packages with C extensions.
66
# - python3-pip: The package installer for Python 3, installed globally.
77
# - swig: Used for wrapping C/C++ libraries for Python.
8-
# - python3-venv: The module to create virtual environments.
98
RUN apt-get update && apt-get install -y --no-install-recommends \
109
python3 \
1110
python3-dev \
1211
python3-pip \
13-
python3-venv \
1412
swig && \
1513
rm -rf /var/lib/apt/lists/*
1614

@@ -22,19 +20,17 @@ RUN ln -sf /usr/bin/python3 /usr/bin/python
2220
# The '-f' flag forces the creation of the symbolic link, overwriting any existing file.
2321
RUN ln -sf /usr/bin/pip3 /usr/bin/pip
2422

25-
# Create a Python virtual environment to avoid system package conflicts.
26-
RUN python3 -m venv /opt/venv
27-
28-
# Set the environment variable for Quarto to use the virtual environment's Python.
29-
ENV QUARTO_PYTHON=/opt/venv/bin/python
30-
31-
# Add the virtual environment's bin directory to the PATH.
32-
ENV PATH="/opt/venv/bin:$PATH"
33-
34-
# Install project requirements into the virtual environment.
35-
# This avoids all system package conflicts.
36-
RUN pip install --no-cache-dir -r https://github.com/geocompx/geocompy/raw/refs/heads/main/requirements.txt
37-
3823
# Install reticulate R package to enable R-Python interoperability
3924
# This step remains the same as it is a separate R installation.
4025
RUN R -e "install.packages('reticulate', repos='https://cloud.r-project.org/')"
26+
27+
# Set the environment variable for Quarto to use the system Python 3.
28+
# The `which python3` command finds the path of the globally installed executable.
29+
ENV QUARTO_PYTHON=/usr/bin/python
30+
31+
# Install project requirements globally using the system's pip3.
32+
# We use `pip3` to ensure we are using the package manager for Python 3.
33+
# The `--break-system-packages` flag is added to override the security feature.
34+
# The `--ignore-installed` flag is added to prevent pip from trying to uninstall
35+
# packages that are managed by the system.
36+
RUN pip3 install --no-cache-dir --break-system-packages --ignore-installed -r https://github.com/geocompx/geocompy/raw/refs/heads/main/requirements.txt

0 commit comments

Comments
 (0)