@@ -2,10 +2,10 @@ ARG GCC_VERSION=15.2.0
22ARG UBUNTU_VERSION=24.04
33
44# ## Build Llama.cpp stage
5- FROM --platform=linux/s390x gcc:${GCC_VERSION} AS build
5+ FROM gcc:${GCC_VERSION} AS build
66
7- RUN --mount=type=cache,target=/var/cache/apt \
8- --mount=type=cache,target=/var/lib/apt/lists \
7+ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
8+ --mount=type=cache,target=/var/lib/apt/lists,sharing=locked \
99 apt update -y && \
1010 apt upgrade -y && \
1111 apt install -y --no-install-recommends \
@@ -40,7 +40,7 @@ COPY requirements /opt/llama.cpp/gguf-py/requirements
4040
4141
4242# ## Collect all llama.cpp binaries, libraries and distro libraries
43- FROM --platform=linux/s390x scratch AS collector
43+ FROM scratch AS collector
4444
4545# Copy llama.cpp binaries and libraries
4646COPY --from=build /opt/llama.cpp/bin /llama.cpp/bin
@@ -49,13 +49,14 @@ COPY --from=build /opt/llama.cpp/gguf-py /llama.cpp/gguf-py
4949
5050
5151# ## Base image
52- FROM --platform=linux/s390x ubuntu:${UBUNTU_VERSION} AS base
52+ FROM ubuntu:${UBUNTU_VERSION} AS base
5353
54- RUN --mount=type=cache,target=/var/cache/apt \
55- --mount=type=cache,target=/var/lib/apt/lists \
54+ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
55+ --mount=type=cache,target=/var/lib/apt/lists,sharing=locked \
5656 apt update -y && \
5757 apt install -y --no-install-recommends \
5858 # WARNING: Do not use libopenblas-openmp-dev. libopenblas-dev is faster.
59+ # See: https://github.com/ggml-org/llama.cpp/pull/15915#issuecomment-3317166506
5960 curl libgomp1 libopenblas-dev && \
6061 apt autoremove -y && \
6162 apt clean -y && \
@@ -68,13 +69,13 @@ COPY --from=collector /llama.cpp/lib /usr/lib/s390x-linux-gnu
6869
6970
7071# ## Full
71- FROM --platform=linux/s390x base AS full
72+ FROM base AS full
7273
7374ENV PATH="/root/.cargo/bin:${PATH}"
7475WORKDIR /app
7576
76- RUN --mount=type=cache,target=/var/cache/apt \
77- --mount=type=cache,target=/var/lib/apt/lists \
77+ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
78+ --mount=type=cache,target=/var/lib/apt/lists,sharing=locked \
7879 apt update -y && \
7980 apt install -y \
8081 git cmake libjpeg-dev \
@@ -97,7 +98,7 @@ ENTRYPOINT [ "/app/tools.sh" ]
9798
9899
99100# ## CLI Only
100- FROM --platform=linux/s390x base AS light
101+ FROM base AS light
101102
102103WORKDIR /llama.cpp/bin
103104
@@ -108,7 +109,7 @@ ENTRYPOINT [ "/llama.cpp/bin/llama-cli" ]
108109
109110
110111# ## Server
111- FROM --platform=linux/s390x base AS server
112+ FROM base AS server
112113
113114ENV LLAMA_ARG_HOST=0.0.0.0
114115
0 commit comments