You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
@thedarkside sorry you're having issues upgrading to Jammy. I think your idea of doing a log cleanup makes sense - unless for some reason a user might want to look at those logs at runtime? Or they might want to look at logs in the case of a failed build
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.The text was updated successfully, but these errors were encountered: