Up until recently I’ve been doing hab docker export
of my hart files to create a docker image of my ruby application for deployment. Once deployed, a number of process-bin files (my_app-rake, my_app-console, etc) were created, added to the path, and consistently worked as expected. Those tools became cornerstones of our processes for running one-off tasks with rake, or debugging with the console.
However, I’ve recently had to switch up my packaging strategy and am now using a dockerfile which installs my .hart as one of it’s steps in order to create my docker image. This has worked well, until I needed to run rake today. The process stubs are no longer added to the path, and if I dig them up and try to run them I get:
./my_app-rake: exec: line 19: bundle: not found
Which tells me there’s environmental stuff that needs to be set, but is missing. Sourcing app_env.sh
is no help, and I wouldn’t expect it to be after looking at the contents. I’ve found though that I can make them fly with:
hab pkg exec my_origin/my_app my_app-rake
Is this expected behavior? It basically works, but there’s gotchas (https://github.com/habitat-sh/habitat/issues/5510) and the inconsistency is confusing.