Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
e1a08464
Unverified
Commit
e1a08464
authored
Sep 22, 2023
by
Michael Yang
Committed by
GitHub
Sep 22, 2023
Browse files
Merge pull request #571 from jmorganca/mxyng/update-dockerfile
update dockerfile.cuda
parents
f997e29e
93d3a256
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
34 deletions
+14
-34
Dockerfile
Dockerfile
+14
-7
Dockerfile.cuda
Dockerfile.cuda
+0
-27
No files found.
Dockerfile
View file @
e1a08464
FROM
golang:alpine
ARG
CUDA_VERSION=12.2.0
FROM
nvidia/cuda:$CUDA_VERSION-devel-ubuntu22.04
ARG
TARGETARCH
ARG
VERSION=0.0.0
WORKDIR
/go/src/github.com/jmorganca/ollama
RUN
apk add
--no-cache
git build-base cmake
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
COPY
. .
RUN
go generate ./...
\
&&
go build
-ldflags
"-linkmode=external -extldflags='-static' -X=github.com/jmorganca/ollama/version.Version=
$VERSION
-X=github.com/jmorganca/ollama/server.mode=release"
.
ENV
GOARCH=$TARGETARCH
RUN
/usr/local/go/bin/go generate ./...
\
&&
/usr/local/go/bin/go build
-ldflags
"-linkmode=external -extldflags='-static' -X=github.com/jmorganca/ollama/version.Version=
$VERSION
-X=github.com/jmorganca/ollama/server.mode=release"
.
FROM
alpine
FROM
ubuntu:22.04
ENV
OLLAMA_HOST 0.0.0.0
RUN
apk add
--no-cache
libstdc++
RUN
apt-get update
&&
apt-get
install
-y
ca-certificates
ARG
USER=ollama
ARG
GROUP=ollama
RUN
add
group
$GROUP
&&
add
user
-
D
-
G
$GROUP
$USER
RUN
group
add
$GROUP
&&
user
add
-
m
-
g
$GROUP
$USER
COPY
--from=0 /go/src/github.com/jmorganca/ollama/ollama /bin/ollama
...
...
Dockerfile.cuda
deleted
100644 → 0
View file @
f997e29e
FROM nvidia/cuda:12.2.0-devel-ubuntu22.04
ARG TARGETARCH
ARG VERSION=0.0.0
WORKDIR /go/src/github.com/jmorganca/ollama
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
COPY . .
ENV GOARCH=$TARGETARCH
RUN /usr/local/go/bin/go generate ./... \
&& /usr/local/go/bin/go build -ldflags "-linkmode=external -extldflags='-static' -X=github.com/jmorganca/ollama/version.Version=$VERSION -X=github.com/jmorganca/ollama/server.mode=release" .
FROM nvidia/cuda:12.2.0-runtime-ubuntu22.04
ENV OLLAMA_HOST 0.0.0.0
ARG USER=ollama
ARG GROUP=ollama
RUN groupadd $GROUP && useradd -m -g $GROUP $USER
COPY --from=0 /go/src/github.com/jmorganca/ollama/ollama /bin/ollama
USER $USER:$GROUP
ENTRYPOINT ["/bin/ollama"]
CMD ["serve"]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment