add nvidia gpu support
change base image from alpine to ubuntu, install ffmpeg5 from ppa and add required deps for nvidia
This commit is contained in:
parent
e69933d525
commit
dc77fa823f
3 changed files with 34 additions and 21 deletions
2
Makefile
2
Makefile
|
|
@ -32,7 +32,7 @@ docker_stage: wheel
|
|||
cp dist/*.whl docker/root/
|
||||
cp -R examples docker/root/defaults/
|
||||
docker: docker_stage
|
||||
sudo docker build --no-cache -t ytdl-sub:local docker/
|
||||
sudo docker build --progress=plain --no-cache -t ytdl-sub:local docker/
|
||||
executable: clean
|
||||
pyinstaller ytdl-sub.spec
|
||||
mv dist/ytdl-sub dist/ytdl-sub${EXEC_SUFFIX}
|
||||
|
|
|
|||
|
|
@ -1,29 +1,41 @@
|
|||
FROM ghcr.io/linuxserver/baseimage-alpine:3.17
|
||||
FROM ghcr.io/linuxserver/baseimage-ubuntu:jammy
|
||||
|
||||
# https://askubuntu.com/questions/972516/debian-frontend-environment-variable
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# https://github.com/NVIDIA/nvidia-docker/wiki/Installation-(Native-GPU-Support)
|
||||
ENV NVIDIA_VISIBLE_DEVICES=all
|
||||
ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility"
|
||||
|
||||
###############################################################################
|
||||
# YTDL-SUB INSTALL
|
||||
|
||||
COPY root/ /
|
||||
RUN mkdir -p /config && \
|
||||
apk update --no-cache && \
|
||||
apk upgrade --no-cache && \
|
||||
apk add --no-cache --repository=http://dl-3.alpinelinux.org/alpine/edge/main/ \
|
||||
apt-get -y update && \
|
||||
apt-get -y upgrade && \
|
||||
apt-get install --no-install-recommends -y \
|
||||
software-properties-common && \
|
||||
add-apt-repository ppa:savoury1/ffmpeg4 && \
|
||||
add-apt-repository ppa:savoury1/ffmpeg5 && \
|
||||
apt-get -y update && \
|
||||
apt-get -y upgrade && \
|
||||
apt-get install --no-install-recommends -y \
|
||||
vim \
|
||||
g++ \
|
||||
nano \
|
||||
make \
|
||||
python3=~3.10 \
|
||||
py3-pip \
|
||||
python3.10-dev \
|
||||
python3-pip \
|
||||
fontconfig \
|
||||
py3-setuptools && \
|
||||
# Install edge ffmpeg, ensure it is properly installed
|
||||
apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community \
|
||||
"ffmpeg>5.1" && \
|
||||
python3-venv \
|
||||
# Ensure ffmpeg is properly installed
|
||||
ffmpeg && \
|
||||
ffmpeg -version && \
|
||||
# Install phantomjs if using x86_64, ensure it is properly installed
|
||||
if [[ $(uname -m) == "x86_64" ]]; then \
|
||||
cd /usr/share && \
|
||||
curl -L https://github.com/Overbryd/docker-phantomjs-alpine/releases/download/2.11/phantomjs-alpine-x86_64.tar.bz2 | tar xj && \
|
||||
curl -L https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2 | tar xj && \
|
||||
ln -s /usr/share/phantomjs/phantomjs /usr/bin/phantomjs && \
|
||||
echo "Phantom JS version:" && \
|
||||
phantomjs --version && \
|
||||
|
|
@ -32,12 +44,17 @@ RUN mkdir -p /config && \
|
|||
# Install ytdl-sub, ensure it is installed properly
|
||||
pip install --no-cache-dir ytdl_sub-*.whl && \
|
||||
ytdl-sub -h && \
|
||||
ldconfig && \
|
||||
# Delete unneeded packages after install
|
||||
rm ytdl_sub-*.whl && \
|
||||
apk del \
|
||||
apt-get remove -y \
|
||||
g++ \
|
||||
make \
|
||||
py3-setuptools
|
||||
python3.10-dev \
|
||||
python3-venv && \
|
||||
apt-get autoremove -y && \
|
||||
apt-get purge -y --auto-remove && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
###############################################################################
|
||||
# CONTAINER CONFIGS
|
||||
|
|
@ -45,8 +62,4 @@ RUN mkdir -p /config && \
|
|||
ENV EDITOR="nano" \
|
||||
HOME="/config"
|
||||
|
||||
VOLUME /config
|
||||
|
||||
|
||||
|
||||
|
||||
VOLUME /config
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
__pypi_version__ = "2023.02.22"
|
||||
__local_version__ = "2023.02.22+40d5517"
|
||||
__pypi_version__ = "2023.03.15"
|
||||
__local_version__ = "2023.03.15+e69933d"
|
||||
|
|
|
|||
Loading…
Reference in a new issue