baalajimaestro
e8f73063d0
Also handle model names easily for docker Signed-off-by: baalajimaestro <me@baalajimaestro.me>
42 lines
No EOL
1.2 KiB
Docker
42 lines
No EOL
1.2 KiB
Docker
FROM intel/oneapi-basekit:2024.2.0-devel-rockylinux9 as build
|
|
|
|
RUN wget $(echo "https://pkgs.dyn.su/el9/base/x86_64/raven-release.el9.noarch.rpm" | sed "s/el9/el$(rpm -q --queryformat '%{RELEASE}' rpm | grep -oP 'el\K[0-9]+')/g") && \
|
|
rpm -ivh raven-release*.rpm && \
|
|
rm -rf raven-release*.rpm && \
|
|
dnf update -y && \
|
|
dnf -y --enablerepo=raven-extras install golang
|
|
|
|
WORKDIR /app
|
|
|
|
ADD . .
|
|
|
|
RUN OLLAMA_CUSTOM_CPU_DEFS="-DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=Intel10_64lp -DLLAMA_NATIVE=ON" go generate ./... && \
|
|
go build -ldflags="-s -w"
|
|
|
|
FROM oraclelinux:9
|
|
|
|
RUN echo -e "[oneAPI]\n\
|
|
name=Intel® oneAPI repository\n\
|
|
baseurl=https://yum.repos.intel.com/oneapi\n\
|
|
enabled=1\n\
|
|
gpgcheck=1\n\
|
|
repo_gpgcheck=1\n\
|
|
gpgkey=https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB" > /tmp/oneAPI.repo
|
|
|
|
RUN mv /tmp/oneAPI.repo /etc/yum.repos.d/oneAPI.repo && \
|
|
dnf update && \
|
|
dnf install intel-oneapi-mkl -y && \
|
|
mkdir /ollama
|
|
|
|
COPY --from=build /app/ollama /ollama
|
|
|
|
ADD entrypoint.sh /
|
|
|
|
ENV MODEL_NAME="llama"
|
|
ENV OLLAMA_HOST="0.0.0.0:8080"
|
|
|
|
EXPOSE 8080
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|
|
|
|
CMD ["/ollama/ollama", "run", "model"] |