3005ec74b3
If a VERSION is not specified, this will generate a version string that represents the state of the repo. For example `0.1.21-12-gffaf52e-dirty` representing 12 commits away from 0.1.21 tag, on commit gffaf52e and the tree is dirty.
15 lines
468 B
Bash
Executable file
15 lines
468 B
Bash
Executable file
#!/bin/sh
|
|
|
|
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\"'"
|
|
|
|
docker build \
|
|
--load \
|
|
--platform=linux/arm64,linux/amd64 \
|
|
--build-arg=VERSION \
|
|
--build-arg=GOFLAGS \
|
|
-f Dockerfile \
|
|
-t ollama/ollama:$VERSION \
|
|
.
|