Open aaronlehmann opened 2 years ago
yes, it is expected, it is optimized out since it can't possibly have side effects. You would need a writable mount for it not to be pruned.
What if it was a curl command making a call to an external API?
Yeah, not saying it is ideal, just the way buildkit works. I am not sure there is any practical usage of readonlyRootfs
except possibly with an aliased mount. Buildkit is designed for artifact generation, not really for arbitrary execution. Perhaps we could get HLB to print a warning when readonlyRootfs
is used without an aliased mount? We could probably also remove the option. The curl
usage will work if we just don't explicitly tell buildkit that there are no outputs with readonlyRootfs
.
Does the
run
get optimized out of the build graph because the readonly root FS means it can't have side effects? I'm not sure this is expected behavior, since it could have side effects outside the context of the filesystem.cc @hinshun @coryb