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

Cache not created/hit when working with Docker #171

@lcmgh

Description

@lcmgh
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions