浏览代码

cache docker builds

Jeffrey Morgan 1 年之前
父节点
当前提交
85e4441c6a
共有 4 个文件被更改,包括 5 次插入0 次删除
  1. 1 0
      .dockerignore
  2. 1 0
      .gitignore
  3. 2 0
      scripts/build_docker.sh
  4. 1 0
      scripts/push_docker.sh

+ 1 - 0
.dockerignore

@@ -6,3 +6,4 @@ scripts
 llm/llama.cpp/ggml
 llm/llama.cpp/gguf
 .env
+.cache

+ 1 - 0
.gitignore

@@ -6,3 +6,4 @@
 dist
 ollama
 ggml-metal.metal
+.cache

+ 2 - 0
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 \
     .

+ 1 - 0
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 \
     .