-
Notifications
You must be signed in to change notification settings - Fork 5
Description
After upgrading to jammy builder and to rails 7.0 (including sprockets-rails upgrade) i am observing a difference in the built image contents. The /log directory now contains empty log files!
I believe it is due to sprockets-rails loading now the complete environment during assets:precompile
resulting in those log files being created.
And because the jammy builder runs the build env with a different user id then the run env, the permissions don't allow writing those files which leads to a crash on startup.
"log to stdout" doesnt help me here either, because my stack outputs multiple log streams. I simply can not mix them in just one STDOUT stream. So i need those files writable during runtime!
Describe the Enhancement
After thinking about different solutions i came to the conclusion that the most elegant one would be to execute a "cleanup" task after compilation in this buildpack.
I mean, if we assume that after executing precompilation some logs getting written, it makes sense to solve this by cleaning up this directory leaving a clean image.
Possible Solution
Just a simple rm -rf /workspace/log/*
after precompile would solve it. Or it could be rollback'ed to the previous state by taking a snapshot before the precompilation and copying over the snapshot after the precompilation.