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
dc87e9c9
Commit
dc87e9c9
authored
Oct 03, 2023
by
Jeffrey Morgan
Browse files
update `Dockerfile` to pass `GOFLAGS`
parent
367cb68d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
Dockerfile
Dockerfile
+1
-1
Dockerfile.build
Dockerfile.build
+3
-3
No files found.
Dockerfile
View file @
dc87e9c9
FROM
nvidia/cuda:11.8.0-devel-ubuntu22.04
ARG
TARGETARCH
ARG
VERSION=0.0.0
ARG
GOFLAGS="'-ldflags=-w -s'"
WORKDIR
/go/src/github.com/jmorganca/ollama
...
...
@@ -11,6 +10,7 @@ RUN mkdir -p /usr/local && tar xz -C /usr/local </tmp/go1.21.1.tar.gz
COPY
. .
ENV
GOARCH=$TARGETARCH
ENV
GOFLAGS=$GOFLAGS
RUN
/usr/local/go/bin/go generate ./...
\
&&
/usr/local/go/bin/go build .
...
...
Dockerfile.build
View file @
dc87e9c9
...
...
@@ -14,6 +14,7 @@ RUN yum install -y git cmake
FROM base-${TARGETARCH}
ARG TARGETARCH
ARG GOFLAGS="'-ldflags -w -s'"
# install go
ADD https://dl.google.com/go/go1.21.1.linux-$TARGETARCH.tar.gz /tmp/go1.21.1.tar.gz
...
...
@@ -22,11 +23,10 @@ RUN mkdir -p /usr/local && tar xz -C /usr/local </tmp/go1.21.1.tar.gz
# build the final binary
WORKDIR /go/src/github.com/jmorganca/ollama
COPY . .
ENV GOOS=linux
ENV GOARCH=$TARGETARCH
ARG VERSION=0.0.0
ARG GOFLAGS="'-ldflags -w -s'"
ENV GOFLAGS=$GOFLAGS
RUN /usr/local/go/bin/go generate ./... && \
/usr/local/go/bin/go build .
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