Skip to content

Commit 8843094

Browse files
committed
fix caching x2
1 parent e3f3c6d commit 8843094

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

Dockerfile

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,18 @@ RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=private \
3636
update-alternatives --set cc /usr/bin/clang &&\
3737
apt-get clean
3838

39-
ENV PATH="/usr/lib/ccache:$PATH" \
40-
CCACHE_DIR=/ccache \
41-
CCACHE_MAXSIZE=400M \
39+
# configure ccache, but do not provide it in path
40+
# each RUN should provide it separately
41+
ENV CCACHE_DIR=/ccache \
42+
CCACHE_MAXSIZE=600M \
4243
CCACHE_COMPRESS=true \
4344
CCACHE_COMPRESSLEVEL=6 \
4445
GOPATH=/go
4546

46-
RUN go install github.com/onsi/ginkgo/[email protected] && \
47+
# golang uses ccache as well
48+
RUN --mount=target=/ccache,type=cache \
49+
PATH="/usr/lib/ccache:$PATH" && \
50+
go install github.com/onsi/ginkgo/[email protected] && \
4751
mv /go/bin/ginkgo /usr/local/bin && \
4852
go install golang.org/x/tools/[email protected] && \
4953
mv /go/bin/gopls /usr/local/bin
@@ -54,6 +58,7 @@ COPY vpp/build/external /vpp-src/build/external
5458
RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=private \
5559
--mount=target=/var/cache/apt,type=cache,sharing=private \
5660
--mount=target=/ccache,type=cache \
61+
PATH="/usr/lib/ccache:$PATH" && \
5762
cd /vpp-src && \
5863
git config --global user.email "[email protected]" && \
5964
git config --global user.name "dummy user" && \
@@ -73,8 +78,8 @@ ADD vpp /vpp-src
7378
# starting from this point, the debug and release buffers differ
7479
ARG BUILD_TYPE
7580

76-
RUN --mount=target=/vpp-src/build-root/.ccache,type=cache \
77-
--mount=target=/ccache,type=cache \
81+
RUN --mount=target=/ccache,type=cache \
82+
PATH="/usr/lib/ccache:$PATH" && \
7883
case ${BUILD_TYPE} in \
7984
debug) \
8085
target="pkg-deb-debug"; \

0 commit comments

Comments
 (0)