build_docker.sh 470 B

1234567891011121314151617
  1. #!/bin/sh
  2. set -eu
  3. export VERSION=${VERSION:-0.0.0}
  4. export GOFLAGS="'-ldflags=-w -s \"-X=github.com/jmorganca/ollama/version.Version=$VERSION\" \"-X=github.com/jmorganca/ollama/server.mode=release\"'"
  5. docker buildx build \
  6. --load \
  7. --platform=linux/arm64,linux/amd64 \
  8. --build-arg=VERSION \
  9. --build-arg=GOFLAGS \
  10. --cache-from type=local,src=.cache \
  11. --cache-to type=local,dest=.cache \
  12. -f Dockerfile \
  13. -t ollama/ollama:$VERSION \
  14. .