Files
whisper.cpp/.devops/main-vulkan.Dockerfile
T
Álvaro Justen 307869af28 devops : reduce Vulkan Docker image to 39.4% of its original size (now 692 MB) (#4038)
* devops : do not install recommended packages

Also:
- Replace apt-get with apt
- Explicitly install ca-certificates

* devops : remove development packages from runtime

* devops : copy only CLI executables and shared libraries

Won't copy compiled tests, source code and other build artifacts.

* devops : remove bash as entrypoint

With this change, arguments passed to `docker run` are forwarded
directly to the selected command.

Having `bash -c` in the entrypoint will cause additional arguments to be
interpreted according to shell command-string semantics, which makes
commands such as model downloaders and CLI tools behave unexpectedly
unless `--entrypoint` is specified explicitly or the whole command is
quoted.

Removing it restores the conventional Docker behavior of: `docker run
IMAGE COMMAND ARG...` passing `ARG` to `COMMAND` (not to `bash`).

* docs : fix + enhance Docker examples
2026-09-21 08:19:14 +02:00

33 lines
1.1 KiB
Docker

FROM ubuntu:24.04 AS build
WORKDIR /app
RUN apt update && \
apt install --no-install-recommends -y build-essential ca-certificates cmake git glslc libvulkan-dev spirv-headers wget \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
COPY .. .
RUN --mount=type=secret,id=HF_TOKEN,required=false,env=HF_TOKEN make base.en CMAKE_ARGS="-DGGML_VULKAN=1"
# Copy only CLI executables and shared libraries (not compiled tests, nor source code or other build artifacts)
RUN mkdir -p /runtime/usr/local/bin /runtime/usr/local/lib && \
for path in build/bin/*; do \
name="${path##*/}"; \
case "$name" in \
*.so|*.so.*) cp -a "$path" /runtime/usr/local/lib/ ;; \
test-*|main|bench) ;; \
*) cp -a "$path" /runtime/usr/local/bin/ ;; \
esac; \
done
FROM ubuntu:24.04 AS runtime
WORKDIR /app
RUN apt update && \
apt install --no-install-recommends -y \
ca-certificates curl ffmpeg libvulkan1 mesa-vulkan-drivers \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
COPY --from=build /runtime/ /
COPY --from=build /app/models/download-* /usr/local/bin/
RUN ldconfig