@@ -13,7 +13,7 @@ RUN apt-get update
1313RUN apt-get -y --no-install-recommends install build-essential curl ca-certificates libva-dev libva-drm2 \
1414 python3 python-is-python3 ninja-build meson git curl
1515# Clean up package cache and temporary files
16- RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
16+ RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* && find /var/log -type f -delete
1717# Update CA certificates
1818RUN update-ca-certificates
1919# Create code directory
@@ -22,13 +22,19 @@ RUN mkdir -p /code
2222RUN git clone --depth 1 https://github.com/NVIDIA/cuda-samples.git /code/cuda-samples
2323# Build deviceQuery
2424RUN cd /code/cuda-samples/Samples/1_Utilities/deviceQuery && make
25- # Move deviceQuery binary to path
26- RUN mv /code/cuda-samples/Samples/1_Utilities/deviceQuery/deviceQuery /usr/local/bin
25+
26+ RUN cd /code/cuda-samples/Samples/1_Utilities/deviceQuery && make && \
27+ mv deviceQuery /usr/local/bin && \
28+ rm -rf /code/cuda-samples
29+
30+ # Cleanup Image
31+ RUN rm -rf /opt/hostedtoolcache && cd /opt && find . -maxdepth 1 -mindepth 1 '!' -path ./containerd '!' -path ./actionarchivecache '!' -path ./runner '!' -path ./runner-cache -exec rm -rf '{}' ';'
2732
2833WORKDIR /app
2934COPY ./build-ffmpeg /app/build-ffmpeg
3035
31- RUN CUDA_COMPUTE_CAPABILITY=$(deviceQuery | grep Capability | head -n 1 | awk 'END {print $NF}' | tr -d '.' ) SKIPINSTALL=yes /app/build-ffmpeg --build --enable-gpl-and-non-free
36+ RUN CUDA_COMPUTE_CAPABILITY=$(deviceQuery | grep Capability | head -n 1 | awk 'END {print $NF}' | tr -d '.' ) SKIPINSTALL=yes /app/build-ffmpeg --build --enable-gpl-and-non-free && \
37+ rm -rf /app/workspace/ffmpeg* /app/workspace/build /app/workspace/packages \
3238
3339FROM ubuntu:${UBUNTUVER} AS release
3440
0 commit comments