Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Cache not created/hit when working with Docker #171

Open
lcmgh opened this issue Nov 10, 2022 · 0 comments
Open

Cache not created/hit when working with Docker #171

lcmgh opened this issue Nov 10, 2022 · 0 comments

Comments

@lcmgh
Copy link

lcmgh commented Nov 10, 2022

FROM mybuilder # has cachepot preinstalled
ARG CARGO_PACKAGE
ENV RUSTC_WRAPPER=/usr/local/cargo/bin/cachepot
ENV CACHEPOT_DIR=/var/cache/cachepot
WORKDIR /build
COPY . /build
RUN --mount=type=cache,target=$CACHEPOT_DIR \
    cargo build --release --no-default-features --bin ${CARGO_PACKAGE}
 docker buildx build \
  -t mycontainer \
  --build-arg CARGO_PACKAGE="myapp" 
.

For some reason cachepot is not being used

#20 [builder 11/14] RUN cachepot --show-stats
#20 0.559 Compile requests                      0
#20 0.559 Compile requests executed             0
#20 0.559 Cache hits                            0
#20 0.559 Cache misses                          0
#20 0.559 Cache timeouts                        0
#20 0.559 Cache read errors                     0
#20 0.559 Forced recaches                       0
#20 0.559 Cache write errors                    0
#20 0.559 Compilation failures                  0
#20 0.559 Cache errors                          0
#20 0.559 Non-cacheable compilations            0
#20 0.559 Non-cacheable calls                   0
#20 0.559 Non-compilation calls                 0
#20 0.559 Unsupported compiler calls            0
#20 0.559 Average cache write               0.000 s
#20 0.559 Average cache read miss           0.000 s
#20 0.559 Average cache read hit            0.000 s
#20 0.559 Failed distributed compilations       0
#20 0.559 Cache location                  Local disk: "/var/cache/cachepot"
#20 0.559 Cache size                          184 MiB
#20 0.559 Max cache size                       10 GiB
#20 DONE 0.7s

/var/cache/cachepot is also empty on the host.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant