You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation does not mention anything about my problem
There are no open or closed issues that are related to my problem
Description
Per title, --cache-from=gha and --cache-to=gha (but probably other cache types too) don't persist the Dockerhub's RUN --mount=type=cache
The proof of concept runs a build push action on a Dockerfile that concatenates the date to a file in the cached folder:
RUN --mount=type=cache,target=/root/mycache \
date >> /root/mycache/cache_file && \
cat /root/mycache/cache_file
The expected behavior is that /root/mycache/cache_file grows steadily one line at a time with each repeated build - like it does in the provided local logs, however when running on GH actions the cache doesn't persist this.
Expected behaviour
When running locally we see that mycache grows steadily:
#8 [stage-0 4/4] RUN --mount=type=cache,target=/root/mycache date >> /root/mycache/cache_file && cat /root/mycache/cache_file
#8 sha256:1b5b68d3b0955db50e94fdbec7bb275606bcdee84e7b5469f32ebdf253121dd1
#8 0.296 Tue Nov 21 06:01:02 UTC 2023
#8 0.296 Tue Nov 21 06:01:31 UTC 2023
#8 0.296 Tue Nov 21 06:02:51 UTC 2023
#8 DONE 0.3s
Actual behaviour
When running remotely, the cache isn't persisted:
#10 [stage-0 4/4] RUN --mount=type=cache,target=/root/mycache date >> /root/mycache/cache_file && cat /root/mycache/cache_file
#10 0.087 Tue Nov 21 05:56:52 UTC 2023
#10 DONE 0.1s
Contributing guidelines
I've found a bug, and:
Description
Per title,
--cache-from=gha
and--cache-to=gha
(but probably other cache types too) don't persist the Dockerhub'sRUN --mount=type=cache
The proof of concept runs a build push action on a Dockerfile that concatenates the date to a file in the cached folder:
The expected behavior is that
/root/mycache/cache_file
grows steadily one line at a time with each repeated build - like it does in the provided local logs, however when running on GH actions the cache doesn't persist this.Expected behaviour
When running locally we see that mycache grows steadily:
Actual behaviour
When running remotely, the cache isn't persisted:
Repository URL
https://github.com/bbozo/docker_cache_gh_actions_bug
Workflow run URL
https://github.com/bbozo/docker_cache_gh_actions_bug/actions/runs/6939857638/job/18877860059
YAML workflow
The text was updated successfully, but these errors were encountered: