Skip to content

Commit 1ef107a

Browse files
committed
fix python install
1 parent 80849cd commit 1ef107a

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

Dockerfile

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,26 @@ FROM sitespeedio/node:ubuntu-24-04-nodejs-22.13.0
22

33
ARG TARGETPLATFORM
44

5-
# Lets install all dependencies for VisualMetrics
5+
# Install dependencies
66
RUN export BUILD=$(if [ "$TARGETPLATFORM" = "linux/amd64" ] ; then echo "amd64"; else echo "arm64"; fi) \
77
buildDeps='wget ca-certificates build-essential' && \
88
apt-get update -y && apt-get install -y \
99
libjpeg-dev \
1010
imagemagick \
1111
python3 \
12+
python3-venv \
1213
python3-dev \
13-
python3-pip \
1414
xz-utils \
1515
$buildDeps \
16-
--no-install-recommends --force-yes && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
17-
python3 -m pip install --upgrade pip && \
18-
python3 -m pip install --upgrade setuptools && \
19-
python3 -m pip install --no-cache-dir pyssim OpenCV-Python Numpy image && \
16+
--no-install-recommends --force-yes && \
17+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
18+
python3 -m venv /opt/venv && \
19+
/opt/venv/bin/pip install --upgrade pip setuptools && \
20+
/opt/venv/bin/pip install --no-cache-dir pyssim OpenCV-Python Numpy image && \
2021
wget https://johnvansickle.com/ffmpeg/old-releases/ffmpeg-5.1.1-$BUILD-static.tar.xz && \
21-
tar --strip-components 1 -C /usr/bin -xf ffmpeg-5.1.1-$BUILD-static.tar.xz --wildcards ffmpeg*/ff* && \
22+
tar --strip-components 1 -C /usr/bin -xf ffmpeg-5.1.1-$BUILD-static.tar.xz --wildcards ffmpeg*/ff* && \
2223
rm ffmpeg-5.1.1-$BUILD-static.tar.xz && \
23-
apt-get purge -y --auto-remove $buildDeps
24+
apt-get purge -y --auto-remove $buildDeps
25+
26+
# Set the virtual environment as the default Python environment
27+
ENV PATH="/opt/venv/bin:$PATH"

0 commit comments

Comments
 (0)