# This has to be built with docker buildx to set the TARGETPLATFORM argument FROM registry.hub.docker.com/library/python:3.10 ARG TARGETPLATFORM # ffmpeg static source (https://johnvansickle.com/ffmpeg/) RUN set -e; \ mkdir /build_ffmpeg; \ cd /build_ffmpeg; \ case "$TARGETPLATFORM" in \ "linux/amd64") ffmpeg_arch="amd64";; \ "linux/arm64") ffmpeg_arch="arm64";; \ "linux/arm/v7") ffmpeg_arch="armhf";; \ *) echo "TARGETPLATFORM $TARGETPLATFORM not found"; exit 1 ;;\ esac; \ wget "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-${ffmpeg_arch}-static.tar.xz"; \ wget "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-${ffmpeg_arch}-static.tar.xz.md5"; \ md5sum -c "ffmpeg-release-${ffmpeg_arch}-static.tar.xz.md5"; \ tar Jxf "ffmpeg-release-${ffmpeg_arch}-static.tar.xz"; \ mv "ffmpeg-5.0.1-${ffmpeg_arch}-static/ffmpeg" /usr/bin; \ cd /; \ rm -rf /build_ffmpeg; # The cryptography package is written in Rust and not available as a built wheel for armv7 # Thats why we need Rust to compile it from source RUN set -e; \ if [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y; \ . $HOME/.cargo/env; \ fi; \ pip install --upgrade pip setuptools poetry; \ rm -rf $HOME/.cargo $HOME/.rustup;