瀏覽代碼

Add buildkit cache when running unit tests

Since running `go test` downloads dependencies we want to have them in
the builder cache
Djordje Lukic 5 年之前
父節點
當前提交
5d073028be
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      Dockerfile

+ 2 - 1
Dockerfile

@@ -63,4 +63,5 @@ COPY --from=make-cross /api/bin/* .
 
 FROM base as test
 ENV CGO_ENABLED=0
-RUN make -f builder.Makefile test
+RUN --mount=id=build,type=cache,target=/root/.cache/go-build \
+    make -f builder.Makefile test