11ARG GCC_VERSION=15.2.0
22ARG UBUNTU_VERSION=24.04
3+ ARG BUILD_DATE=N/A
4+ ARG APP_VERSION=N/A
5+ ARG APP_REVISION=N/A
36
47# ## Build Llama.cpp stage
58FROM gcc:${GCC_VERSION} AS build
@@ -34,6 +37,7 @@ RUN --mount=type=cache,target=/root/.ccache \
3437
3538COPY *.py /opt/llama.cpp/bin
3639COPY .devops/tools.sh /opt/llama.cpp/bin
40+ COPY conversion /opt/llama.cpp/conversion
3741
3842COPY gguf-py /opt/llama.cpp/gguf-py
3943COPY requirements.txt /opt/llama.cpp/gguf-py
@@ -44,14 +48,28 @@ COPY requirements /opt/llama.cpp/gguf-py/requirements
4448FROM scratch AS collector
4549
4650# Copy llama.cpp binaries and libraries
47- COPY --from=build /opt/llama.cpp/bin /llama.cpp/bin
48- COPY --from=build /opt/llama.cpp/lib /llama.cpp/lib
49- COPY --from=build /opt/llama.cpp/gguf-py /llama.cpp/gguf-py
51+ COPY --from=build /opt/llama.cpp/bin /llama.cpp/bin
52+ COPY --from=build /opt/llama.cpp/lib /llama.cpp/lib
53+ COPY --from=build /opt/llama.cpp/gguf-py /llama.cpp/gguf-py
54+ COPY --from=build /opt/llama.cpp/conversion /llama.cpp/conversion
5055
5156
5257# ## Base image
5358FROM ubuntu:${UBUNTU_VERSION} AS base
5459
60+ ARG BUILD_DATE=N/A
61+ ARG APP_VERSION=N/A
62+ ARG APP_REVISION=N/A
63+ ARG IMAGE_URL=https://github.com/ggml-org/llama.cpp
64+ ARG IMAGE_SOURCE=https://github.com/ggml-org/llama.cpp
65+ LABEL org.opencontainers.image.created=$BUILD_DATE \
66+ org.opencontainers.image.version=$APP_VERSION \
67+ org.opencontainers.image.revision=$APP_REVISION \
68+ org.opencontainers.image.title="llama.cpp" \
69+ org.opencontainers.image.description="LLM inference in C/C++" \
70+ org.opencontainers.image.url=$IMAGE_URL \
71+ org.opencontainers.image.source=$IMAGE_SOURCE
72+
5573RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
5674 --mount=type=cache,target=/var/lib/apt/lists,sharing=locked \
5775 apt update -y && \
@@ -91,6 +109,7 @@ RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
91109
92110COPY --from=collector /llama.cpp/bin /app
93111COPY --from=collector /llama.cpp/gguf-py /app/gguf-py
112+ COPY --from=collector /llama.cpp/conversion /app/conversion
94113
95114RUN pip install --no-cache-dir --break-system-packages \
96115 -r /app/gguf-py/requirements.txt
0 commit comments