1- ARG UBUNTU_VERSION=24 .04
1+ ARG UBUNTU_VERSION=26 .04
22
33FROM ubuntu:$UBUNTU_VERSION AS build
44
5- # Ref: https://vulkan.lunarg.com/doc/sdk/latest/linux/getting_started.html
6-
75# Install build tools
86RUN apt update && apt install -y git build-essential cmake wget xz-utils
97
10- # Install Vulkan SDK
11- ARG VULKAN_VERSION=1.4.321.1
12- RUN ARCH=$(uname -m) && \
13- wget -qO /tmp/vulkan-sdk.tar.xz https://sdk.lunarg.com/sdk/download/${VULKAN_VERSION}/linux/vulkan-sdk-linux-${ARCH}-${VULKAN_VERSION}.tar.xz && \
14- mkdir -p /opt/vulkan && \
15- tar -xf /tmp/vulkan-sdk.tar.xz -C /tmp --strip-components=1 && \
16- mv /tmp/${ARCH}/* /opt/vulkan/ && \
17- rm -rf /tmp/*
18-
198# Install cURL and Vulkan SDK dependencies
209RUN apt install -y libcurl4-openssl-dev curl \
21- libxcb-xinput0 libxcb-xinerama0 libxcb-cursor-dev
22-
23- # Set environment variables
24- ENV VULKAN_SDK=/opt/vulkan
25- ENV PATH=$VULKAN_SDK/bin:$PATH
26- ENV LD_LIBRARY_PATH=$VULKAN_SDK/lib:$LD_LIBRARY_PATH
27- ENV CMAKE_PREFIX_PATH=$VULKAN_SDK:$CMAKE_PREFIX_PATH
28- ENV PKG_CONFIG_PATH=$VULKAN_SDK/lib/pkgconfig:$PKG_CONFIG_PATH
10+ libxcb-xinput0 libxcb-xinerama0 libxcb-cursor-dev libvulkan-dev glslc
2911
3012# Build it
3113WORKDIR /app
3214
3315COPY . .
3416
35- RUN cmake -B build -DGGML_NATIVE=OFF -DGGML_VULKAN=1 -DLLAMA_BUILD_TESTS=OFF -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON && \
17+ RUN cmake -B build -DGGML_NATIVE=OFF -DGGML_VULKAN=ON -DLLAMA_BUILD_TESTS=OFF -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON && \
3618 cmake --build build --config Release -j$(nproc)
3719
3820RUN mkdir -p /app/lib && \
39- find build -name "*.so" -exec cp {} /app/lib \;
21+ find build -name "*.so* " -exec cp -P {} /app/lib \;
4022
4123RUN mkdir -p /app/full \
4224 && cp build/bin/* /app/full \
@@ -50,7 +32,7 @@ RUN mkdir -p /app/full \
5032FROM ubuntu:$UBUNTU_VERSION AS base
5133
5234RUN apt-get update \
53- && apt-get install -y libgomp1 curl libvulkan-dev \
35+ && apt-get install -y libgomp1 curl libvulkan1 mesa-vulkan-drivers \
5436 && apt autoremove -y \
5537 && apt clean -y \
5638 && rm -rf /tmp/* /var/tmp/* \
@@ -68,6 +50,7 @@ WORKDIR /app
6850
6951RUN apt-get update \
7052 && apt-get install -y \
53+ build-essential \
7154 git \
7255 python3 \
7356 python3-pip \
0 commit comments