2023-09-26 17:38:32 +00:00
|
|
|
#!/bin/sh
|
2023-09-22 19:20:12 +00:00
|
|
|
|
2023-09-26 17:38:32 +00:00
|
|
|
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\"'"
|
2023-09-22 19:20:12 +00:00
|
|
|
|
|
|
|
mkdir -p dist
|
|
|
|
|
2023-11-14 01:20:34 +00:00
|
|
|
for TARGETARCH in amd64 arm64; do
|
2023-11-29 19:00:37 +00:00
|
|
|
docker buildx build --load --progress=plain --platform=linux/$TARGETARCH --build-arg=VERSION --build-arg=GOFLAGS -f Dockerfile.build -t builder:$TARGETARCH .
|
2023-09-26 17:38:32 +00:00
|
|
|
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
|
2023-09-22 19:20:12 +00:00
|
|
|
done
|