fluentd-docker-image icon indicating copy to clipboard operation
fluentd-docker-image copied to clipboard

Keeping derived images upwards-compatible

Open Brandl opened this issue 8 years ago • 0 comments

Per default gem installs user-packages under /home/fluent/.gem/ruby/2.2.0/bin:$PATH Note the ruby version number in there...

So as the user needs to add this to his path, this will likely break as soon as we switch to another ruby version. So how do we solve this?

Options:

  • Installing them as root. We could recommend the user to install them before he switches to as less-privileged user, like we do in our base-image. (Does this have any security-implications, or break stuff?)
  • Bash scripting (ugly, but works): for dir in $HOME/.gem/ruby/*; do [ -d "$dir/bin" ] && PATH="${dir}/bin:${PATH}" done
  • What the ruby docs say (http://guides.rubygems.org/faqs/#user-install) if which ruby >/dev/null && which gem >/dev/null; then PATH="$(ruby -rubygems -e 'puts Gem.user_dir')/bin:$PATH" fi
  • Using rvm/bundler/... for package managment (additional bloat)?

Brandl avatar Jan 08 '16 23:01 Brandl