Skip to content

Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.

cache docker builds

Jeffrey Morgan85e4441c6a47
diff --git a/.dockerignore b/.dockerignore
index a9253852d..150c8f6ed 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -6,3 +6,4 @@ scripts
llm/llama.cpp/ggml
llm/llama.cpp/gguf
.env
+.cache
diff --git a/.gitignore b/.gitignore
index 1e9ab3f4b..feb68d6c4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,4 @@
dist
ollama
ggml-metal.metal
+.cache
diff --git a/scripts/build_docker.sh b/scripts/build_docker.sh
index 1f612def2..9cfb41134 100755
--- a/scripts/build_docker.sh
+++ b/scripts/build_docker.sh
@@ -10,6 +10,8 @@ docker buildx build \
--platform=linux/arm64,linux/amd64 \
--build-arg=VERSION \
--build-arg=GOFLAGS \
+ --cache-from type=local,src=.cache \
+ --cache-to type=local,dest=.cache \
-f Dockerfile \
-t ollama \
.
diff --git a/scripts/push_docker.sh b/scripts/push_docker.sh
index 3f3fb2137..31865c2b7 100755
--- a/scripts/push_docker.sh
+++ b/scripts/push_docker.sh
@@ -10,6 +10,7 @@ docker buildx build \
--platform=linux/arm64,linux/amd64 \
--build-arg=VERSION \
--build-arg=GOFLAGS \
+ --cache-from type=local,src=.cache \
-f Dockerfile \
-t ollama/ollama -t ollama/ollama:$VERSION \
.