cd5c8f6471
* Optimize container images for startup This change adjusts how to handle runner payloads to support container builds where we keep them extracted in the filesystem. This makes it easier to optimize the cpu/cuda vs cpu/rocm images for size, and should result in faster startup times for container images. * Refactor payload logic and add buildx support for faster builds * Move payloads around * Review comments * Converge to buildx based helper scripts * Use docker buildx action for release
29 lines
No EOL
760 B
Bash
Executable file
29 lines
No EOL
760 B
Bash
Executable file
#!/bin/sh
|
|
#
|
|
# 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
|
|
|
|
|
|
set -eu
|
|
|
|
. $(dirname $0)/env.sh
|
|
|
|
mkdir -p dist
|
|
|
|
docker buildx build \
|
|
--output type=local,dest=./dist/ \
|
|
--platform=${PLATFORM} \
|
|
${OLLAMA_COMMON_BUILD_ARGS} \
|
|
--target dist \
|
|
-f Dockerfile \
|
|
.
|
|
|
|
# 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 |