Skip to content

Commit 30138fb

Browse files
Update Dockerfile to add a virtual environment for Python, this should fix conflicts with system packages that are making the build fail
1 parent fc56be5 commit 30138fb

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

Dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,30 @@ RUN apt-get update && \
1616
unzip \
1717
python3-pip \
1818
libpq-dev python3 \
19+
python3-venv \
1920
&& apt-get autoclean && \
2021
apt-get autoremove && \
2122
rm -rf /var/lib/{apt,dpkg,cache,log}
2223

24+
# Create a virtual environment
25+
RUN python3 -m venv /opt/venv
26+
27+
# Permanently add the virtual environment to the execution PATH
28+
ENV PATH="/opt/venv/bin:$PATH"
2329
# Pip installation
2430
# RUN pip install --upgrade pip==23.1 setuptools==59.7.0
2531
RUN mkdir -p /conf
2632
COPY requirements.txt /conf/
2733
COPY constraints.txt /conf/
28-
RUN pip install -r /conf/requirements.txt -c /conf/constraints.txt --break-system-packages
34+
RUN pip install -r /conf/requirements.txt -c /conf/constraints.txt
2935
# RUN pip install --upgrade pip==23.1 setuptools==59.7.0
3036
# Copy source code and install it
3137
RUN mkdir -p /code
3238
WORKDIR /code
3339
ADD . /code
3440

3541
RUN echo "Installing dea-conflux through the Dockerfile."
36-
RUN pip install . -c /conf/constraints.txt --break-system-packages
37-
42+
RUN pip install . -c /conf/constraints.txt
3843
RUN pip freeze && pip check
3944

4045
# Make sure it's working

0 commit comments

Comments
 (0)