While working on the Changelog.com config, I found that running dagger with --no-cache caused #CacheDir to not persist needed files across tasks (not just runs - that's expected).
As seen below, I download dependencies in deps (into /app/deps, and those dependencies would not be in a subsequent task depsCompileProd when that #CacheDir is mounted.
actions: {
depsCache: engine.#CacheDir & {
id: "depsCache"
}
depsCacheMount: "depsCache": {
dest: *"/app/deps/" | string
contents: depsCache
}
deps: engine.#Exec & {
input: _
mounts: depsCacheMount
workdir: "/app"
args: ["bash", "-c", " mix deps.get"]
}
depsCompileProd: engine.#Exec & {
input: deps.output
env: MIX_ENV: "prod"
mounts: depsCacheMount
workdir: "/app"
args: ["bash", "-c", "mix do deps.compile, compile"]
}
}
per @aluzzardi, we should repro with docker RUN --mount and add a --no-cache test to tests/tasks/exec/mount_cache.cue
While working on the Changelog.com config, I found that running
daggerwith--no-cachecaused#CacheDirto not persist needed files across tasks (not just runs - that's expected).As seen below, I download dependencies in
deps(into/app/deps, and those dependencies would not be in a subsequent taskdepsCompileProdwhen that#CacheDiris mounted.per @aluzzardi, we should repro with
docker RUN --mountand add a--no-cachetest totests/tasks/exec/mount_cache.cue