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
53d694c6
Unverified
Commit
53d694c6
authored
Feb 27, 2024
by
Daniel Hiltgen
Committed by
GitHub
Feb 27, 2024
Browse files
Merge pull request #2772 from dhiltgen/container_image
Refine container image build script
parents
5aa6bfea
98e0b7e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
scripts/build_docker.sh
scripts/build_docker.sh
+12
-3
No files found.
scripts/build_docker.sh
View file @
53d694c6
...
...
@@ -5,13 +5,15 @@ set -eu
export
VERSION
=
${
VERSION
:-
$(
git describe
--tags
--first-parent
--abbrev
=
7
--long
--dirty
--always
|
sed
-e
"s/^v//g"
)
}
export
GOFLAGS
=
"'-ldflags=-w -s
\"
-X=github.com/jmorganca/ollama/version.Version=
$VERSION
\"
\"
-X=github.com/jmorganca/ollama/server.mode=release
\"
'"
IMAGE_NAME
=
${
IMAGE_NAME
:-
"ollama/ollama"
}
BUILD_PLATFORM
=
${
BUILD_PLATFORM
:-
"linux/arm64,linux/amd64"
}
docker build
\
--load
\
--platform
=
linux/arm64,linux/amd64
\
--platform
=
${
BUILD_PLATFORM
}
\
--build-arg
=
VERSION
\
--build-arg
=
GOFLAGS
\
-f
Dockerfile
\
-t
ollama/ollama
:
$VERSION
\
-t
${
IMAGE_NAME
}
:
$VERSION
\
.
docker build
\
...
...
@@ -21,5 +23,12 @@ docker build \
--build-arg
=
GOFLAGS
\
--target
runtime-rocm
\
-f
Dockerfile
\
-t
ollama/ollama
:
$VERSION
-rocm
\
-t
${
IMAGE_NAME
}
:
$VERSION
-rocm
\
.
docker tag
${
IMAGE_NAME
}
:
$VERSION
${
IMAGE_NAME
}
:latest
docker tag
${
IMAGE_NAME
}
:
$VERSION
-rocm
${
IMAGE_NAME
}
:rocm
echo
"To release, run:"
echo
" docker push
${
IMAGE_NAME
}
:
$VERSION
&& docker push
${
IMAGE_NAME
}
:latest"
echo
" docker push
${
IMAGE_NAME
}
:
$VERSION
-rocm && docker push
${
IMAGE_NAME
}
:rocm"
\ No newline at end of file
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