alpaca.cpp icon indicating copy to clipboard operation
alpaca.cpp copied to clipboard

Dockerfile for build and run

Open raldebsi opened this issue 1 year ago • 3 comments

This is a Dockerfile that builds and runs. Let me know if it works for you and/or you want a PR.

FROM ubuntu:18.04

# Add GCC and G++ New
RUN apt-get update && apt-get install software-properties-common curl git -qy 
RUN add-apt-repository ppa:ubuntu-toolchain-r/test && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 42D5A192B819C5DA

# Add CMAKE New
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
RUN apt-add-repository "deb https://apt.kitware.com/ubuntu/ bionic main" && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6AF7F09730B3F0A4

RUN apt-get update

# Install
RUN apt-get install -qy cmake gcc-10 g++-10

# Configure
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 30 && update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 30
RUN update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30 && update-alternatives --set cc /usr/bin/gcc
RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30 && update-alternatives --set c++ /usr/bin/g++


WORKDIR /app
RUN git clone https://github.com/rupeshs/alpaca.cpp.git /app


RUN mkdir build && cmake -B build .
WORKDIR /app/build
RUN cmake --build . --config Release

# #RUN curl -o ggml-alpaca-7b-q4.bin -C - https://gateway.estuary.tech/gw/ipfs/QmQ1bf2BTnYxq73MFJWu1B7bQ2UD6qG7D7YDCxhTndVkPC

CMD ["./chat", "-m", "/models/ggml-alpaca-13b-q4.bin"]

raldebsi avatar Mar 23 '23 11:03 raldebsi

This should be included in the repo for sure

minicoz avatar Mar 29 '23 03:03 minicoz

Why 18.04 specifically though? Shouldn't we at least be using 20.04 for the container? If you're looking for a stable container use Alpine or Debian.

HadetTheUndying avatar Mar 29 '23 22:03 HadetTheUndying

Why 18.04 specifically though? Shouldn't we at least be using 20.04 for the container? If you're looking for a stable container use Alpine or Debian.

My docker version does not support images built on top of >=20.04, so the latest version that worked for me was 18.04. Besides, I have tested this and it's working fine for me, as well as it is compatible with all backwards/future CUDA images from nvcr.io (they use 18.04 as well) so might as well keep it for old CUDA 10.

You are free to modify it if you want to whatever suits you

raldebsi avatar Mar 29 '23 22:03 raldebsi