From 5d073028bec56af5ff058c751d5cd890dbc34de5 Mon Sep 17 00:00:00 2001 From: Djordje Lukic Date: Fri, 22 May 2020 13:26:30 +0200 Subject: [PATCH] Add buildkit cache when running unit tests Since running `go test` downloads dependencies we want to have them in the builder cache --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 96b38530d..f59a155f7 100644 --- a/Dockerfile +++ b/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