|
| 1 | +ARG VER=8 |
| 2 | + |
| 3 | +FROM nvidia/cuda:11.6.0-devel-centos${VER} AS build |
| 4 | + |
| 5 | +ENV NVIDIA_VISIBLE_DEVICES all |
| 6 | +ENV NVIDIA_DRIVER_CAPABILITIES compute,utility,video |
| 7 | + |
| 8 | + |
| 9 | +# Fix EOL Mirror issue |
| 10 | +RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-* |
| 11 | +# Pick one of these mirrors that works. vault.centos.org was giving me timeout issues |
| 12 | +# RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-* |
| 13 | +# RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://linuxsoft.cern.ch/centos-vault/|g' /etc/yum.repos.d/CentOS-Linux-* |
| 14 | +# RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://archive.kernel.org/centos-vault/|g' /etc/yum.repos.d/CentOS-Linux-* |
| 15 | +RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://mirror.nsc.liu.se/centos-store|g' /etc/yum.repos.d/CentOS-Linux-* |
| 16 | + |
| 17 | +# upgrade to Rocky Linux 8 |
| 18 | +RUN dnf install -y ncurses \ |
| 19 | + && dnf clean all \ |
| 20 | + && rm -rf /var/cache/dnf \ |
| 21 | + && rm -rf /var/cache/yum \ |
| 22 | + && dnf install -y dnf-plugins-core \ |
| 23 | + && dnf -y update |
| 24 | + |
| 25 | +WORKDIR /opt/conversion_to_rocky |
| 26 | +RUN curl -O https://raw.githubusercontent.com/rocky-linux/rocky-tools/main/migrate2rocky/migrate2rocky.sh && \ |
| 27 | + chmod +x migrate2rocky.sh && \ |
| 28 | + bash migrate2rocky.sh -r |
| 29 | + |
| 30 | + |
| 31 | +RUN yum group install -y "Development Tools" \ |
| 32 | + && yum install -y curl libva-devel python3 \ |
| 33 | + && yum install -y meson ninja-build --enablerepo=powertools \ |
| 34 | + && rm -rf /var/cache/yum/* /var/cache/dnf/* \ |
| 35 | + && yum clean all \ |
| 36 | + && alternatives --set python /usr/bin/python3 |
| 37 | + |
| 38 | +WORKDIR /app |
| 39 | +COPY ./build-ffmpeg /app/build-ffmpeg |
| 40 | + |
| 41 | +RUN SKIPINSTALL=yes /app/build-ffmpeg --build --enable-gpl-and-non-free |
| 42 | + |
| 43 | + |
| 44 | +FROM rockylinux:${VER} |
| 45 | + |
| 46 | +ENV NVIDIA_VISIBLE_DEVICES all |
| 47 | +ENV NVIDIA_DRIVER_CAPABILITIES compute,utility,video |
| 48 | + |
| 49 | +# install va-driver |
| 50 | +RUN yum install -y libva \ |
| 51 | + && rm -rf /var/cache/yum/* \ |
| 52 | + && yum clean all |
| 53 | + |
| 54 | +# Copy libnpp |
| 55 | +COPY --from=build /usr/local/cuda-11.6/targets/x86_64-linux/lib/libnppc.so.11 /lib64/libnppc.so.11 |
| 56 | +COPY --from=build /usr/local/cuda-11.6/targets/x86_64-linux/lib/libnppig.so.11 /lib64/libnppig.so.11 |
| 57 | +COPY --from=build /usr/local/cuda-11.6/targets/x86_64-linux/lib/libnppicc.so.11 /lib64/libnppicc.so.11 |
| 58 | +COPY --from=build /usr/local/cuda-11.6/targets/x86_64-linux/lib/libnppidei.so.11 /lib64/libnppidei.so.11 |
| 59 | +COPY --from=build /usr/local/cuda-11.6/targets/x86_64-linux/lib/libnppif.so.11 /lib64/libnppif.so.11 |
| 60 | + |
| 61 | +# Copy ffmpeg |
| 62 | +COPY --from=build /app/workspace/bin/ffmpeg /usr/bin/ffmpeg |
| 63 | +COPY --from=build /app/workspace/bin/ffprobe /usr/bin/ffprobe |
| 64 | +COPY --from=build /app/workspace/bin/ffplay /usr/bin/ffplay |
| 65 | + |
| 66 | +# Check shared library |
| 67 | +RUN ldd /usr/bin/ffmpeg |
| 68 | +RUN ldd /usr/bin/ffprobe |
| 69 | +RUN ldd /usr/bin/ffplay |
| 70 | + |
| 71 | +CMD ["--help"] |
| 72 | +ENTRYPOINT ["/usr/bin/ffmpeg"] |
0 commit comments