build_docker.sh 669 B

12345678910111213141516171819202122232425
  1. #!/bin/sh
  2. set -eu
  3. export VERSION=${VERSION:-$(git describe --tags --first-parent --abbrev=7 --long --dirty --always | sed -e "s/^v//g")}
  4. export GOFLAGS="'-ldflags=-w -s \"-X=github.com/jmorganca/ollama/version.Version=$VERSION\" \"-X=github.com/jmorganca/ollama/server.mode=release\"'"
  5. docker build \
  6. --load \
  7. --platform=linux/arm64,linux/amd64 \
  8. --build-arg=VERSION \
  9. --build-arg=GOFLAGS \
  10. -f Dockerfile \
  11. -t ollama/ollama:$VERSION \
  12. .
  13. docker build \
  14. --load \
  15. --platform=linux/amd64 \
  16. --build-arg=VERSION \
  17. --build-arg=GOFLAGS \
  18. --target runtime-rocm \
  19. -f Dockerfile \
  20. -t ollama/ollama:$VERSION-rocm \
  21. .