@@ -49,17 +49,15 @@ COPY --from=build /opt/llama.cpp/bin /llama.cpp/bin
4949COPY --from=build /opt/llama.cpp/lib /llama.cpp/lib
5050COPY --from=build /opt/llama.cpp/gguf-py /llama.cpp/gguf-py
5151
52- # Copy all shared libraries from distro
53- # COPY --from=build /usr/lib/s390x-linux-gnu /lib
54-
5552
5653# ## Base image
5754FROM --platform=linux/s390x ubuntu:${UBUNTU_VERSION} AS base
5855
5956RUN --mount=type=cache,target=/var/cache/apt \
6057 --mount=type=cache,target=/var/lib/apt/lists \
6158 apt update -y && \
62- apt install -y curl libgomp1 libopenblas-dev && \
59+ apt install -y --no-install-recommends \
60+ curl libgomp1 libopenblas-dev && \
6361 apt autoremove -y && \
6462 apt clean -y && \
6563 rm -rf /tmp/* /var/tmp/* && \
@@ -69,8 +67,31 @@ RUN --mount=type=cache,target=/var/cache/apt \
6967# Copy llama.cpp libraries
7068COPY --from=collector /llama.cpp/lib /usr/lib/s390x-linux-gnu
7169
72- # Copy all distro libraries
73- # COPY --from=collector /lib /lib/s390x-linux-gnu
70+
71+ # ## Full
72+ FROM --platform=linux/s390x base AS full
73+
74+ ENV PATH="/root/.cargo/bin:${PATH}"
75+ WORKDIR /app
76+
77+ RUN --mount=type=cache,target=/var/cache/apt \
78+ --mount=type=cache,target=/var/lib/apt/lists \
79+ apt update -y && \
80+ apt install -y git python3 python3-pip python3-dev && \
81+ apt autoremove -y && \
82+ apt clean -y && \
83+ rm -rf /tmp/* /var/tmp/* && \
84+ find /var/cache/apt/archives /var/lib/apt/lists -not -name lock -type f -delete && \
85+ find /var/cache -type f -delete
86+
87+ RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
88+
89+ COPY --from=collector /llama.cpp/bin /app
90+ COPY --from=collector /llama.cpp/gguf-py /app/gguf-py
91+
92+ RUN pip install --no-cache-dir -r /app/gguf-py/requirements.txt
93+
94+ ENTRYPOINT [ "/app/tools.sh" ]
7495
7596
7697# ## CLI Only
@@ -84,7 +105,7 @@ COPY --from=collector /llama.cpp/bin/llama-cli /llama.cpp/bin
84105ENTRYPOINT [ "/llama.cpp/bin/llama-cli" ]
85106
86107
87- # ## Hardened Server
108+ # ## Server
88109FROM --platform=linux/s390x base AS server
89110
90111ENV LLAMA_ARG_HOST=0.0.0.0
0 commit comments