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 dist/*.whl docker/root/
|
||||||
cp -R examples docker/root/defaults/
|
cp -R examples docker/root/defaults/
|
||||||
docker: docker_stage
|
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
|
executable: clean
|
||||||
pyinstaller ytdl-sub.spec
|
pyinstaller ytdl-sub.spec
|
||||||
mv dist/ytdl-sub dist/ytdl-sub${EXEC_SUFFIX}
|
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
|
# YTDL-SUB INSTALL
|
||||||
|
|
||||||
COPY root/ /
|
COPY root/ /
|
||||||
RUN mkdir -p /config && \
|
RUN mkdir -p /config && \
|
||||||
apk update --no-cache && \
|
apt-get -y update && \
|
||||||
apk upgrade --no-cache && \
|
apt-get -y upgrade && \
|
||||||
apk add --no-cache --repository=http://dl-3.alpinelinux.org/alpine/edge/main/ \
|
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 \
|
vim \
|
||||||
g++ \
|
g++ \
|
||||||
nano \
|
nano \
|
||||||
make \
|
make \
|
||||||
python3=~3.10 \
|
python3.10-dev \
|
||||||
py3-pip \
|
python3-pip \
|
||||||
fontconfig \
|
fontconfig \
|
||||||
py3-setuptools && \
|
python3-venv \
|
||||||
# Install edge ffmpeg, ensure it is properly installed
|
# Ensure ffmpeg is properly installed
|
||||||
apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community \
|
ffmpeg && \
|
||||||
"ffmpeg>5.1" && \
|
|
||||||
ffmpeg -version && \
|
ffmpeg -version && \
|
||||||
# Install phantomjs if using x86_64, ensure it is properly installed
|
# Install phantomjs if using x86_64, ensure it is properly installed
|
||||||
if [[ $(uname -m) == "x86_64" ]]; then \
|
if [[ $(uname -m) == "x86_64" ]]; then \
|
||||||
cd /usr/share && \
|
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 && \
|
ln -s /usr/share/phantomjs/phantomjs /usr/bin/phantomjs && \
|
||||||
echo "Phantom JS version:" && \
|
echo "Phantom JS version:" && \
|
||||||
phantomjs --version && \
|
phantomjs --version && \
|
||||||
|
|
@ -32,12 +44,17 @@ RUN mkdir -p /config && \
|
||||||
# Install ytdl-sub, ensure it is installed properly
|
# Install ytdl-sub, ensure it is installed properly
|
||||||
pip install --no-cache-dir ytdl_sub-*.whl && \
|
pip install --no-cache-dir ytdl_sub-*.whl && \
|
||||||
ytdl-sub -h && \
|
ytdl-sub -h && \
|
||||||
|
ldconfig && \
|
||||||
# Delete unneeded packages after install
|
# Delete unneeded packages after install
|
||||||
rm ytdl_sub-*.whl && \
|
rm ytdl_sub-*.whl && \
|
||||||
apk del \
|
apt-get remove -y \
|
||||||
g++ \
|
g++ \
|
||||||
make \
|
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
|
# CONTAINER CONFIGS
|
||||||
|
|
@ -45,8 +62,4 @@ RUN mkdir -p /config && \
|
||||||
ENV EDITOR="nano" \
|
ENV EDITOR="nano" \
|
||||||
HOME="/config"
|
HOME="/config"
|
||||||
|
|
||||||
VOLUME /config
|
VOLUME /config
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
__pypi_version__ = "2023.02.22"
|
__pypi_version__ = "2023.03.15"
|
||||||
__local_version__ = "2023.02.22+40d5517"
|
__local_version__ = "2023.03.15+e69933d"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue