2023-09-25 23:52:05 -07:00
|
|
|
FROM nvidia/cuda:11.8.0-devel-ubuntu22.04
|
2023-09-22 11:57:31 -07:00
|
|
|
|
|
|
|
ARG TARGETARCH
|
2023-09-08 13:41:49 -07:00
|
|
|
ARG VERSION=0.0.0
|
2023-09-30 13:34:01 -07:00
|
|
|
ARG GOFLAGS="'-ldflags=-w -s'"
|
2023-09-08 13:41:49 -07:00
|
|
|
|
2023-07-03 18:56:17 -04:00
|
|
|
WORKDIR /go/src/github.com/jmorganca/ollama
|
2023-09-22 11:57:31 -07:00
|
|
|
RUN apt-get update && apt-get install -y git build-essential cmake
|
|
|
|
ADD https://dl.google.com/go/go1.21.1.linux-$TARGETARCH.tar.gz /tmp/go1.21.1.tar.gz
|
|
|
|
RUN mkdir -p /usr/local && tar xz -C /usr/local </tmp/go1.21.1.tar.gz
|
2023-09-06 14:14:20 -07:00
|
|
|
|
2023-07-03 18:56:17 -04:00
|
|
|
COPY . .
|
2023-09-22 11:57:31 -07:00
|
|
|
ENV GOARCH=$TARGETARCH
|
|
|
|
RUN /usr/local/go/bin/go generate ./... \
|
2023-09-26 10:38:32 -07:00
|
|
|
&& /usr/local/go/bin/go build .
|
2023-07-03 18:56:17 -04:00
|
|
|
|
2023-09-22 11:57:31 -07:00
|
|
|
FROM ubuntu:22.04
|
|
|
|
RUN apt-get update && apt-get install -y ca-certificates
|
2023-09-06 14:14:20 -07:00
|
|
|
COPY --from=0 /go/src/github.com/jmorganca/ollama/ollama /bin/ollama
|
2023-09-30 12:32:06 -07:00
|
|
|
EXPOSE 11434
|
|
|
|
ENV OLLAMA_HOST 0.0.0.0
|
2023-07-03 18:56:17 -04:00
|
|
|
ENTRYPOINT ["/bin/ollama"]
|
2023-07-06 16:34:14 -04:00
|
|
|
CMD ["serve"]
|