2022-04-01 06:23:46 +00:00
|
|
|
# Name: Video2X Dockerfile
|
2022-02-04 21:00:38 +00:00
|
|
|
# Creator: K4YT3X
|
|
|
|
# Date Created: February 3, 2022
|
2024-10-08 02:29:00 +00:00
|
|
|
# Last Modified: October 7, 2024
|
2022-02-04 21:00:38 +00:00
|
|
|
|
|
|
|
# stage 1: build the python components into wheels
|
2024-10-08 02:29:00 +00:00
|
|
|
FROM docker.io/archlinux:latest AS builder
|
2022-02-04 21:00:38 +00:00
|
|
|
|
2024-10-08 02:29:00 +00:00
|
|
|
# Install dependencies and create a non-root user
|
|
|
|
RUN pacman -Syy --noconfirm \
|
|
|
|
base-devel ffmpeg ncnn git cmake make clang pkgconf vulkan-headers openmp sudo \
|
|
|
|
nvidia-utils vulkan-radeon vulkan-intel vulkan-swrast \
|
|
|
|
&& useradd -m builder \
|
|
|
|
&& echo 'builder ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/builder
|
|
|
|
|
|
|
|
# Switch to the non-root user and copy the source code
|
|
|
|
USER builder
|
|
|
|
COPY --chown=builder:builder . /video2x
|
2022-02-04 21:00:38 +00:00
|
|
|
WORKDIR /video2x
|
2024-10-08 02:29:00 +00:00
|
|
|
|
|
|
|
# Build the package
|
|
|
|
RUN makepkg -s --noconfirm \
|
2024-10-10 07:23:13 +00:00
|
|
|
&& find /video2x -maxdepth 1 -name 'video2x-*.pkg.tar.zst' ! -name '*-debug-*' | head -n 1 | \
|
2024-10-08 02:29:00 +00:00
|
|
|
xargs -I {} cp {} /tmp/video2x.pkg.tar.zst
|
2022-02-04 21:00:38 +00:00
|
|
|
|
|
|
|
# stage 2: install wheels into the final image
|
2024-10-08 02:29:00 +00:00
|
|
|
FROM docker.io/archlinux:latest
|
2022-02-04 21:00:38 +00:00
|
|
|
LABEL maintainer="K4YT3X <i@k4yt3x.com>" \
|
|
|
|
org.opencontainers.image.source="https://github.com/k4yt3x/video2x" \
|
2024-10-08 02:29:00 +00:00
|
|
|
org.opencontainers.image.description="A lossless video super resolution framework"
|
|
|
|
|
2022-03-21 00:21:00 +00:00
|
|
|
ENV VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json\
|
|
|
|
:/usr/share/vulkan/icd.d/radeon_icd.x86_64.json\
|
|
|
|
:/usr/share/vulkan/icd.d/intel_icd.x86_64.json
|
2022-02-04 21:00:38 +00:00
|
|
|
|
2024-10-08 02:29:00 +00:00
|
|
|
COPY --from=builder /tmp/video2x.pkg.tar.zst /video2x.pkg.tar.zst
|
|
|
|
RUN pacman -Sy --noconfirm ffmpeg ncnn \
|
|
|
|
nvidia-utils vulkan-radeon vulkan-intel vulkan-swrast \
|
|
|
|
&& pacman -U --noconfirm /video2x.pkg.tar.zst \
|
|
|
|
&& rm -rf /video2x.pkg.tar.zst /var/cache/pacman/pkg/*
|
2022-02-04 21:00:38 +00:00
|
|
|
|
|
|
|
WORKDIR /host
|
2024-10-08 02:29:00 +00:00
|
|
|
ENTRYPOINT ["/usr/bin/video2x"]
|