@@ -13,7 +13,7 @@ RUN apt-get update
13
13
RUN apt-get -y --no-install-recommends install build-essential curl ca-certificates libva-dev libva-drm2 \
14
14
python3 python-is-python3 ninja-build meson git curl
15
15
# 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
17
17
# Update CA certificates
18
18
RUN update-ca-certificates
19
19
# Create code directory
@@ -22,13 +22,19 @@ RUN mkdir -p /code
22
22
RUN git clone --depth 1 https://github.com/NVIDIA/cuda-samples.git /code/cuda-samples
23
23
# Build deviceQuery
24
24
RUN 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 '{}' ';'
27
32
28
33
WORKDIR /app
29
34
COPY ./build-ffmpeg /app/build-ffmpeg
30
35
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 \
32
38
33
39
FROM ubuntu:${UBUNTUVER} AS release
34
40
0 commit comments