Skip to content

core: make cache directory configurable#1537

Merged
abiosoft merged 1 commit intoabiosoft:mainfrom
reillylm:feature/colima-cache-dir
Mar 12, 2026
Merged

core: make cache directory configurable#1537
abiosoft merged 1 commit intoabiosoft:mainfrom
reillylm:feature/colima-cache-dir

Conversation

@reillylm
Copy link
Copy Markdown
Contributor

@reillylm reillylm commented Mar 8, 2026

I routinely run out of space on my Macbook's 256GB drive. I have COLIMA_HOME set on an external drive to hold the Lima disks, but it would be nice to have the cache directory there too.

I wasn't sure if we wanted to require the directory already exist (as we do with $COLIMA_HOME) or create the directory automatically (as we do with $LIMA_HOME), so I picked the latter (otherwise, it'll fall back silently to the default, which feels wrong if we're explicitly setting the env var).

Noted the new env var down in the FAQ file. Also moved where we talk about the env vars from #1522, since I thought it was a little confusing how it was written. Specifically, COLIMA_HOME / COLIMA_PROFILE / DOCKER_CONFIG are env vars for the host to configure the Colima CLI (or Docker CLI), whereas --env is used to inject env vars into the guest VM, so I tried to make that more clear.

@reillylm
Copy link
Copy Markdown
Contributor Author

reillylm commented Mar 8, 2026

@abiosoft side note: I noticed that the FAQ page in the docs and the FAQ.md file in the repo don't exactly match. Also that the rest of the docs pages from the website are not in the repo. For example, for env vars, I noticed that the env YAML config property is already covered in the Configuration page on the docs, so I'm not sure if you wanted to just remove the FAQ entry altogether?

@abiosoft
Copy link
Copy Markdown
Owner

The cache directory is actually a special case as it is always mounted in the VM, downloaded artifacts needed in the VM are retrieved via the mounted cache directory. Therefore, locating it on external disk would remove the guarantee of it always being mounted.

Further updates are needed in that regard before this PR can be merged.

As for the FAQ, yeah, the website is more detailed. I plan to eventually get rid of the FAQ.md file and direct users to the website instead.

@abiosoft
Copy link
Copy Markdown
Owner

FYI, you can clear the cache (to save disk space) with colima prune command.

@abiosoft
Copy link
Copy Markdown
Owner

@reillylm you can do a rebase and we should be good to go 👍🏽

I routinely run out of space on my Macbook's 256GB drive. I have `COLIMA_HOME` set on an external drive to hold the Lima disks, but it would be nice to have the cache directory there too.

I wasn't sure if we wanted to require the directory already exist (as we do with `$COLIMA_HOME`) or create the directory automatically (as we do with `$LIMA_HOME`), so I picked the latter (otherwise, it'll fall back silently to the default, which feels wrong if we're explicitly setting the env var).

Noted the new env var down in the FAQ file. Also moved where we talk about the env vars from abiosoft#1522, since I thought it was a little confusing how it was written. Specifically, `COLIMA_HOME` / `COLIMA_PROFILE` / `DOCKER_CONFIG` are env vars for the host to configure the Colima CLI (or Docker CLI), whereas `--env` is used to inject env vars into the guest VM, so I tried to make that more clear.

Signed-off-by: reillylm <reillylm@users.noreply.github.com>
@reillylm reillylm force-pushed the feature/colima-cache-dir branch from d41e258 to 9ec54d1 Compare March 12, 2026 19:03
@reillylm
Copy link
Copy Markdown
Contributor Author

Hmm interesting, I thought the cache directory was only used when creating a VM the first time to download the disk image?

@abiosoft abiosoft changed the title make Colima cache directory configurable core: make cache directory configurable Mar 12, 2026
@abiosoft
Copy link
Copy Markdown
Owner

Hmm interesting, I thought the cache directory was only used when creating a VM the first time to download the disk image?

It was used for more than that.

@abiosoft abiosoft merged commit 8cb5d35 into abiosoft:main Mar 12, 2026
12 checks passed
@abiosoft
Copy link
Copy Markdown
Owner

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants