Is there any way to cache docker images for use in CI? #583
-
I've been using testcontainers for tests running in CI for a while, and one thing I hadn't thought about is how it will cache images. The mongodb image we use is ~400MB, and I assume it's pulling that on every run currently. Is there a certain folder I can cache in my CI (ex. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hi @alex-statsig, I assume your mongodb image is being built with Testcontainers? If yes then indeed the built image will be removed once the test suite ends because of the resource reaper (ryuk). If this is undesired you can simply turn off the resource reaper by setting the env variable |
Beta Was this translation helpful? Give feedback.
-
I use https://github.com/ScribeMD/docker-cache which works well for me. |
Beta Was this translation helpful? Give feedback.
Could you pls give a bit more info about the GH built-in cache to which you are referring?
Docker itself maintains its own image cache, I believe in
/var/lib/docker/<storage-driver>
. There's nothing custom that Testcontainers adds on top.