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
ec261422
Commit
ec261422
authored
Jan 02, 2024
by
Jeffrey Morgan
Browse files
use `docker build` in build scripts
parent
22cd5eaa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
6 deletions
+3
-6
scripts/build_docker.sh
scripts/build_docker.sh
+1
-3
scripts/build_linux.sh
scripts/build_linux.sh
+1
-1
scripts/push_docker.sh
scripts/push_docker.sh
+1
-2
No files found.
scripts/build_docker.sh
View file @
ec261422
...
...
@@ -5,13 +5,11 @@ set -eu
export
VERSION
=
${
VERSION
:-
0
.0.0
}
export
GOFLAGS
=
"'-ldflags=-w -s
\"
-X=github.com/jmorganca/ollama/version.Version=
$VERSION
\"
\"
-X=github.com/jmorganca/ollama/server.mode=release
\"
'"
docker
buildx
build
\
docker build
\
--load
\
--platform
=
linux/arm64,linux/amd64
\
--build-arg
=
VERSION
\
--build-arg
=
GOFLAGS
\
--cache-from
type
=
local
,src
=
.cache
\
--cache-to
type
=
local
,dest
=
.cache
\
-f
Dockerfile
\
-t
ollama/ollama:
$VERSION
\
.
scripts/build_linux.sh
View file @
ec261422
...
...
@@ -8,7 +8,7 @@ export GOFLAGS="'-ldflags=-w -s \"-X=github.com/jmorganca/ollama/version.Version
mkdir
-p
dist
for
TARGETARCH
in
amd64 arm64
;
do
docker build
x build
--load
--platform
=
linux/
$TARGETARCH
--build-arg
=
VERSION
--build-arg
=
GOFLAGS
--build-arg
=
CGO_CFLAGS
--cache-from
type
=
local
,src
=
.cache
--cache-to
type
=
local
,dest
=
.cache
-f
Dockerfile.build
-t
builder:
$TARGETARCH
.
docker build
--platform
=
linux/
$TARGETARCH
--build-arg
=
VERSION
--build-arg
=
GOFLAGS
--build-arg
=
CGO_CFLAGS
-f
Dockerfile.build
-t
builder:
$TARGETARCH
.
docker create
--platform
linux/
$TARGETARCH
--name
builder-
$TARGETARCH
builder:
$TARGETARCH
docker
cp
builder-
$TARGETARCH
:/go/src/github.com/jmorganca/ollama/ollama ./dist/ollama-linux-
$TARGETARCH
docker
rm
builder-
$TARGETARCH
...
...
scripts/push_docker.sh
View file @
ec261422
...
...
@@ -5,12 +5,11 @@ set -eu
export
VERSION
=
${
VERSION
:-
0
.0.0
}
export
GOFLAGS
=
"'-ldflags=-w -s
\"
-X=github.com/jmorganca/ollama/version.Version=
$VERSION
\"
\"
-X=github.com/jmorganca/ollama/server.mode=release
\"
'"
docker
buildx
build
\
docker build
\
--push
\
--platform
=
linux/arm64,linux/amd64
\
--build-arg
=
VERSION
\
--build-arg
=
GOFLAGS
\
--cache-from
type
=
local
,src
=
.cache
\
-f
Dockerfile
\
-t
ollama/ollama
-t
ollama/ollama:
$VERSION
\
.
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