2023-09-26 10:38:32 -07:00
|
|
|
#!/bin/sh
|
2024-09-12 12:10:30 -07:00
|
|
|
#
|
|
|
|
# Mac ARM users, rosetta can be flaky, so to use a remote x86 builder
|
|
|
|
#
|
|
|
|
# docker context create amd64 --docker host=ssh://mybuildhost
|
|
|
|
# docker buildx create --name mybuilder amd64 --platform linux/amd64
|
|
|
|
# docker buildx create --name mybuilder --append desktop-linux --platform linux/arm64
|
|
|
|
# docker buildx use mybuilder
|
|
|
|
|
2023-09-22 15:20:12 -04:00
|
|
|
|
2023-09-26 10:38:32 -07:00
|
|
|
set -eu
|
|
|
|
|
2024-09-12 12:10:30 -07:00
|
|
|
. $(dirname $0)/env.sh
|
2023-09-22 15:20:12 -04:00
|
|
|
|
|
|
|
mkdir -p dist
|
|
|
|
|
2024-09-12 12:10:30 -07:00
|
|
|
docker buildx build \
|
|
|
|
--output type=local,dest=./dist/ \
|
|
|
|
--platform=${PLATFORM} \
|
|
|
|
${OLLAMA_COMMON_BUILD_ARGS} \
|
|
|
|
--target dist \
|
2024-01-21 11:37:11 -08:00
|
|
|
-f Dockerfile \
|
|
|
|
.
|
2024-09-12 12:10:30 -07:00
|
|
|
|
|
|
|
# buildx behavior changes for single vs. multiplatform
|
|
|
|
if echo $PLATFORM | grep "," > /dev/null ; then
|
|
|
|
mv -f ./dist/linux_*64/ollama* ./dist/
|
|
|
|
rmdir ./dist/linux_*64
|
|
|
|
fi
|