Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update python and ffmpeg version in docker cuda #5582

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 39 additions & 6 deletions docker/build/x86_64/Dockerfile-CUDA
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This dockerfile should be built with `make docker-cuda-build` from the stash root.

# Build Frontend
FROM node:alpine as frontend
FROM node:alpine AS frontend
RUN apk add --no-cache make git
## cache node_modules separately
COPY ./ui/v2.5/package.json ./ui/v2.5/yarn.lock /stash/ui/v2.5/
Expand All @@ -16,7 +16,7 @@ ARG STASH_VERSION
RUN BUILD_DATE=$(date +"%Y-%m-%d %H:%M:%S") make ui

# Build Backend
FROM golang:1.22-bullseye as backend
FROM golang:1.22-bullseye AS backend
RUN apt update && apt install -y build-essential golang
WORKDIR /stash
COPY ./go* ./*.go Makefile gqlgen.yml .gqlgenc.yml /stash/
Expand All @@ -32,8 +32,41 @@ RUN make flags-release flags-pie stash

# Final Runnable Image
FROM nvidia/cuda:12.0.1-base-ubuntu22.04
RUN apt update && apt upgrade -y && apt install -y ca-certificates libvips-tools ffmpeg wget intel-media-va-driver-non-free vainfo
RUN rm -rf /var/lib/apt/lists/*
ENV TZ=US/Pacific \
DEBIAN_FRONTEND=noninteractive
ARG PYTHON_VERSION=3.12
RUN echo "deb https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy main" | tee /etc/apt/sources.list.d/deadsnakes.list \
&& echo "deb-src https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy main" | tee -a /etc/apt/sources.list.d/deadsnakes.list \
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys F23C5A6CF475977595C89F51BA6932366A755776 \
&& apt update && apt upgrade -y && apt install -y ca-certificates libvips-tools wget intel-media-va-driver-non-free \
vainfo \
# install python3.12 && set python3.12 as default python
&& apt install -y python3.12 \
&& update-alternatives --install /usr/bin/python python /usr/bin/python$PYTHON_VERSION 1 \
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python$PYTHON_VERSION 1 \
&& update-alternatives --set python /usr/bin/python$PYTHON_VERSION \
&& update-alternatives --set python3 /usr/bin/python$PYTHON_VERSION \
# install ffmpeg 6 with nvenc support
&& wget https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2023-03-31-12-50/ffmpeg-n6.0-11-g3980415627-linux64-gpl-6.0.tar.xz \
&& tar -xf ffmpeg-n6.0-11-g3980415627-linux64-gpl-6.0.tar.xz \
&& mv ffmpeg-n6.0-11-g3980415627-linux64-gpl-6.0/bin/ffmpeg /usr/bin/ffmpeg \
&& mv ffmpeg-n6.0-11-g3980415627-linux64-gpl-6.0/bin/ffprobe /usr/bin/ffprobe \
&& chmod +x /usr/bin/ffmpeg /usr/bin/ffprobe \
&& rm -rf ffmpeg-n6.0-11-g3980415627-linux64-gpl-6.0.tar.xz ffmpeg-n6.0-11-g3980415627-linux64-gpl-6.0 \
# clean apt cache
&& apt autoremove -y \
&& apt autoclean -y \
&& apt clean && rm -rf \
/var/cache/debconf/* \
/var/lib/apt/lists/* \
/var/log/* \
/var/tmp/* \
&& rm -rf /tmp/*
# install some python packages
RUN wget -qO- https://bootstrap.pypa.io/get-pip.py | python3.12 \
&& pip install cloudscraper bs4 stashapp-tools lxml \
# clean pip cache
&& rm -rf /root/.cache/pip
COPY --from=backend /stash/stash /usr/bin/

# NVENC Patch
Expand All @@ -42,8 +75,8 @@ RUN wget https://raw.githubusercontent.com/keylase/nvidia-patch/master/patch.sh
RUN wget https://raw.githubusercontent.com/keylase/nvidia-patch/master/docker-entrypoint.sh -O /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/patch.sh /usr/local/bin/docker-entrypoint.sh /usr/bin/stash

ENV LANG C.UTF-8
ENV NVIDIA_VISIBLE_DEVICES all
ENV LANG=C.UTF-8
ENV NVIDIA_VISIBLE_DEVICES=all
ENV NVIDIA_DRIVER_CAPABILITIES=video,utility
ENV STASH_CONFIG_FILE=/root/.stash/config.yml
EXPOSE 9999
Expand Down
Loading