Skip to content

Commit

Permalink
build multi-platform without Python2
Browse files Browse the repository at this point in the history
  • Loading branch information
soulgalore committed Feb 25, 2021
1 parent 33d0de3 commit cae4547
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
28 changes: 15 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
FROM sitespeedio/node:ubuntu-20.04-nodejs-12.16.2
FROM sitespeedio/node:ubuntu-20.04-nodejs-14.16.0

ARG TARGETPLATFORM

# Lets install all dependencies for VisualMetrics
RUN buildDeps='wget ca-certificates' && \
RUN export BUILD=$(if [ "$TARGETPLATFORM" = "linux/amd64" ] ; then echo "amd64"; else echo "arm64"; fi) \
buildDeps='wget ca-certificates' && \
apt-get update -y && apt-get install -y \
imagemagick \
libjpeg-dev \
python2 \
python2-dev \
python3 \
python3-dev \
python3-pip \
python-is-python3 \
xz-utils \
$buildDeps \
--no-install-recommends --force-yes && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
wget https://bootstrap.pypa.io/get-pip.py && \
python2 get-pip.py && \
python2 -m pip install --upgrade pip && \
python2 -m pip install --upgrade setuptools && \
python2 -m pip install pyssim && \
update-alternatives --install /usr/bin/python python /usr/bin/python2 1 && \
wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz && \
tar --strip-components 1 -C /usr/bin -xf ffmpeg-release-amd64-static.tar.xz --wildcards */ffmpeg && \
rm ffmpeg-release-amd64-static.tar.xz && \
python -m pip install --upgrade pip && \
python -m pip install --upgrade setuptools && \
python -m pip install pyssim pyssim Pillow image && \
wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-$BUILD-static.tar.xz && \
tar --strip-components 1 -C /usr/bin -xf ffmpeg-release-$BUILD-static.tar.xz --wildcards */ffmpeg && \
rm ffmpeg-release-$BUILD-static.tar.xz && \
apt-get purge -y --auto-remove $buildDeps
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# Docker VisualMetrics dependencies
Adds the dependencies needed by [VisualMetrics](https://github.com/WPO-Foundation/visualmetrics) to sitespeed.io [base container](https://github.com/sitespeedio/docker-node).


```
docker buildx build --push --platform linux/arm64,linux/amd64 -t sitespeedio/visualmetrics-deps:ffmpeg-4.2.2-imagemagick-6.9.10-23-p2-c .
```

0 comments on commit cae4547

Please sign in to comment.