ARG UBUNTU_VERSION=22.04 # This needs to generally match the container host's environment. ARG CUDA_VERSION=12.2.0 # Target the CUDA build image ARG BASE_CUDA_DEV_CONTAINER=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION} # Target the CUDA runtime image ARG BASE_CUDA_RUN_CONTAINER=nvidia/cuda:${CUDA_VERSION}-runtime-ubuntu${UBUNTU_VERSION} FROM ${BASE_CUDA_DEV_CONTAINER} AS build ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ apt-get install -y build-essential git cmake libcurl4-openssl-dev curl sed wget nvidia-driver-535 WORKDIR /app RUN apt install -y sudo && adduser --disabled-password --gecos '' docker && adduser docker sudo && echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers USER docker WORKDIR /home/docker ENV NODE_VERSION=22.11.0 RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash ENV NVM_DIR=/home/docker/.nvm RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION} RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION} RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION} ENV PATH="/home/docker/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}" RUN node --version RUN npm --version RUN git clone https://github.com/ggerganov/llama.cpp --depth 1 WORKDIR /home/docker/llama.cpp RUN sed -i 's/-lcublas /-lcublas_static /g' Makefile && \ sed -i 's/-lcublasLt /-lcublasLt_static /g' Makefile && \ sed -i 's/-lcudart /-lcudart_static /g' Makefile RUN npm i -g http-server CMD ["bash", "-c", "(http-server -p 7860 -c-1)& CUDA_DOCKER_ARCH=compute_80 GGML_CUDA=1 LLAMA_CURL=1 make llama-server -j && ldd llama-server && sleep 999999999"]