-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
introduction of BUNDLE_APP_CONFIG leads to unexpected behavior for 'statically' bundled apps #129
Comments
I'll 👍 the question. Moving to the official ruby image killed our I can solve it by dumping the env to a file and then sourcing it, but that's just... argh. |
I agree, this also hit me know; I had to start debugging and looking into intermediate containers etc (our setup is a multi-container build, because we have a Ruby builder image and a node.js builder image, and then a minimal runtime image with It's especially annoying since Docker does not allow me to delete an ENV variable, not that I know of. So know I have to hardwire it to I am very much 👍 for removing |
The |
Valid points. It did cause me to waste a bit of time debugging an unexpected override of the Can we document this somewhere? Is it already documented perhaps? I think it's much easier for us to accept the way it is now, if it is clearly documented that it's done on purpose, for good and valid reasons. |
Do we have to explicitly declare Actually, I also confused as unfamiliar variables were set automatically. |
This recently bit me. It's tempting to for the ruby docker images just to do one that does not set ENV vars. |
This just got me too. Thanks to everyone in this thread, I'm back up and running :-) |
I've also been wondering about this. Although it doesn't appear to be doing me any harm(yet?), I don't seem to need it either. I run a unset BUNDLE_APP_CONFIG before starting my app to get rid of the variable. This works around the fact that you cannot remove the @machisuke Even though For reference, I use something like the following to get a shell prompt when working on a Rails project docker run --rm -it -v $PWD:/usr/src -w /usr/src -u $UID:$GID \
-e HOME=/usr/src -e GEM_HOME=/usr/src/vendor/bundle \
-e PATH=/usr/src/vendor/bundle:/usr/local/bin:/usr/bin:/bin \
-p 3000:3000 ruby \
bash -c 'unset BUNDLE_APP_CONFIG; exec bash' |
In #69 the file based configuration for bundler was changed to a ENV based approach. This MR also adds a new configuration option for bundler:
BUNDLE_APP_CONFIG
, which changes how and where bundler looks for additional configuration. For example see https://github.com/docker-library/ruby/pull/69/files#diff-1578307c887a49e90a57418e653ad7f6R51Bundlers default is:
Which is imho a smart separation of project vs. global/user configuration, however in our docker based use case there really isn't a need for global bundler configuration.
With this setting set via Dockerfile ENV, we loose the ability to ship bundler configs with our apps. There are multiple ways of getting an app into the container, be it at buildtime or runtime (COPY'd,
-v
ed or wget'ed during runtime ...) and not all necessarily include runningbundle install
at start up time! The main reason I noticed this behavior is because of one of my apps uses private gems that we bundle statically withbundle install --deployment
. For those unfamiliar with the--deployment
option, it basically does two things: 1. installs gems to a subdirectory of the project (commonly tovendor/bundle
right besides the Gemfile) and 2. creates a.bundler/config
file which changes the bundler path (per-project!) to the local directory the gems were just installed into.Example of a FROM ruby:2.3 image:
I am aware that one can easily change that behavior back to the default by changing the ENV when running the image, but I was wondering why we decided to change it in the first place? Pretty sure I am just missing something here and there is a good reason. cc @tianon
The text was updated successfully, but these errors were encountered: