Skip to content
Open
Show file tree
Hide file tree
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
17 changes: 12 additions & 5 deletions nvidia-php8.1-fpm-ffmpeg-bullseye/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
FROM nvidia as base
ENV DEBIAN_FRONTEND noninteractive
ENV TZ Etc/UTC
ENV LD_LIBRARY_PATH /usr/local/nvidia/lib64
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig/
ENV LD_LIBRARY_PATH /usr/local/nvidia/lib64:/usr/local/lib
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/src/zimg
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES video,compute,utility
# Update base and install build tools
Expand Down Expand Up @@ -65,9 +65,15 @@ RUN git clone --depth=1 https://gitlab.com/AOMediaCodec/SVT-AV1 && cd SVT-AV1/Bu
# Install libaom from source.
RUN git clone https://aomedia.googlesource.com/aom && cmake ./aom && \
make && make install
RUN git clone https://github.com/FFmpeg/nv-codec-headers.git -b old/sdk/9.0 && cd nv-codec-headers && \
RUN git clone https://github.com/FFmpeg/nv-codec-headers.git -b sdk/11.1 && cd nv-codec-headers && \
make && make install
RUN git clone https://github.com/FFmpeg/FFmpeg -b release/5.1 && \
# install libzimg
RUN git clone --branch release-3.0.4 --depth 1 https://github.com/sekrit-twc/zimg && cd zimg &&\
./autogen.sh &&\
./configure &&\
make -j $(nproc) && \
make install
RUN git clone https://github.com/FFmpeg/FFmpeg -b release/6.0 && \
cd /src/FFmpeg && \
./configure \
--prefix="/usr/local" \
Expand All @@ -88,6 +94,7 @@ RUN git clone https://github.com/FFmpeg/FFmpeg -b release/5.1 && \
--enable-libvpx \
--enable-libx264 \
--enable-libx265 \
--enable-libzimg \
--enable-nonfree \
--enable-nvenc \
--enable-opencl \
Expand All @@ -98,7 +105,7 @@ RUN git clone https://github.com/FFmpeg/FFmpeg -b release/5.1 && \
--extra-ldflags="-L/usr/local/nvidia/lib64/" && \
make -j$(nproc) && make install


# Copy ffmpeg binary back to base image without compilation layers
FROM base as nvidia-php-ffmpeg
COPY --from=ffmpeg-builder /usr/local/lib /usr/local/lib
COPY --from=ffmpeg-builder /usr/local/bin /usr/local/bin
5 changes: 5 additions & 0 deletions nvidia-php8.1-fpm-ffmpeg-bullseye/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@
```shell
docker build --target=nvidia-php-ffmpeg -t us.gcr.io/cloudkite-public/nvidia-php8.1-fpm-ffmpeg-bullseye .
```
### Building with cloudbuild
Substitute `_IMAGE_TAG` value with an appropriate value for tagging the built docker image, it defaults to `latest`.
```
gcloud builds submit --project=cloudkite-public --config cloudbuild.yaml --substitutions=_IMAGE_TAG="<image tag here>" --timeout=2h
```
9 changes: 9 additions & 0 deletions nvidia-php8.1-fpm-ffmpeg-bullseye/cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
substitutions:
_GCLOUD_PROJECT: cloudkite-public
_GCR_REGISTRY: nvidia-php8.1-fpm-ffmpeg-bullseye
_IMAGE_TAG: latest
steps:
- name: 'gcr.io/cloud-builders/docker'
args: [ 'build', '-t', 'us.gcr.io/${_GCLOUD_PROJECT}/${_GCR_REGISTRY}:${_IMAGE_TAG}', '.' ]
images:
- us.gcr.io/${_GCLOUD_PROJECT}/${_GCR_REGISTRY}:${_IMAGE_TAG}