Although I can show some source code illustrating the issue, let me first state what I am trying to do in general terms:
I am using the Go SDK and the issue I am about to explain shows up no matter what Dagger version I use, including the latest v0.18.5.
When running a command inside a Dagger container using WithExec, the command itself needs to store its own state by writing out into some dot folders local to the working directory inside the container.
The problem I am having is that, even when using cache busting with a volatile input and also calling Sync at the end of the command writing its state out, these dot folders disappear when the next WithExec command is invoked.
I am not using a mounted directory. I am just using WithDirectory, though this command's state is being stored in the same directory in the container brought in by WithDirectory.
I am sure there is some nuance when it comes to how I am using the container or I am doing something verboten by passing around the container pointer from function to function.
Anyway, here is the code:
https://github.com/frizzr/dagger-module-helm/blob/5201dc4d4/helm/main.go#L463
The context of the code at the link above is that at the top-level I am calling the Lint function, which then calls setupContainerForDependentCharts which then calls registryLogin (which is when it writes out its dot folders) but when running the very next call into the container with debugEnv, it reports back that the dot folder previously present in the previous command is now gone.
Thanks in advance for the help!