From 7df74adde38bb34445bdcf8b25319ec41d3a1b7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Fri, 3 Jan 2020 14:43:33 +0100 Subject: [PATCH] Add paths scoped to ruby version to PATH and GEM_PATH Newer bundler versions install gems to `$GEM_HOME/ruby/`, instead of directly to `$GEM_HOME`. So we need to add the proper paths to `GEM_PATH` and `PATH` so that gems and their executables are properly found. --- 2.4/alpine3.10/Dockerfile | 3 ++- 2.4/alpine3.11/Dockerfile | 3 ++- 2.4/buster/Dockerfile | 3 ++- 2.4/buster/slim/Dockerfile | 3 ++- 2.4/stretch/Dockerfile | 3 ++- 2.4/stretch/slim/Dockerfile | 3 ++- 2.5/alpine3.10/Dockerfile | 3 ++- 2.5/alpine3.11/Dockerfile | 3 ++- 2.5/buster/Dockerfile | 3 ++- 2.5/buster/slim/Dockerfile | 3 ++- 2.5/stretch/Dockerfile | 3 ++- 2.5/stretch/slim/Dockerfile | 3 ++- 2.6/alpine3.10/Dockerfile | 3 ++- 2.6/alpine3.11/Dockerfile | 3 ++- 2.6/buster/Dockerfile | 3 ++- 2.6/buster/slim/Dockerfile | 3 ++- 2.6/stretch/Dockerfile | 3 ++- 2.6/stretch/slim/Dockerfile | 3 ++- 2.7/alpine3.10/Dockerfile | 3 ++- 2.7/alpine3.11/Dockerfile | 3 ++- 2.7/buster/Dockerfile | 3 ++- 2.7/buster/slim/Dockerfile | 3 ++- Dockerfile-alpine.template | 3 ++- Dockerfile-debian.template | 3 ++- Dockerfile-slim.template | 3 ++- 25 files changed, 50 insertions(+), 25 deletions(-) diff --git a/2.4/alpine3.10/Dockerfile b/2.4/alpine3.10/Dockerfile index d7a0721b7..3251bb268 100644 --- a/2.4/alpine3.10/Dockerfile +++ b/2.4/alpine3.10/Dockerfile @@ -124,10 +124,11 @@ RUN set -eux; \ # install things globally, for great justice # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle +ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH ENV BUNDLE_PATH="$GEM_HOME" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" -ENV PATH $GEM_HOME/bin:$PATH +ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH # adjust permissions of a few directories for running "gem install" as an arbitrary user RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME" # (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both) diff --git a/2.4/alpine3.11/Dockerfile b/2.4/alpine3.11/Dockerfile index 94068dc72..65508ec3d 100644 --- a/2.4/alpine3.11/Dockerfile +++ b/2.4/alpine3.11/Dockerfile @@ -124,10 +124,11 @@ RUN set -eux; \ # install things globally, for great justice # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle +ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH ENV BUNDLE_PATH="$GEM_HOME" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" -ENV PATH $GEM_HOME/bin:$PATH +ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH # adjust permissions of a few directories for running "gem install" as an arbitrary user RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME" # (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both) diff --git a/2.4/buster/Dockerfile b/2.4/buster/Dockerfile index 47981d772..7cb34416d 100644 --- a/2.4/buster/Dockerfile +++ b/2.4/buster/Dockerfile @@ -83,10 +83,11 @@ RUN set -eux; \ # install things globally, for great justice # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle +ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH ENV BUNDLE_PATH="$GEM_HOME" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" -ENV PATH $GEM_HOME/bin:$PATH +ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH # adjust permissions of a few directories for running "gem install" as an arbitrary user RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME" # (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both) diff --git a/2.4/buster/slim/Dockerfile b/2.4/buster/slim/Dockerfile index 20ab5f247..0cc5b7af3 100644 --- a/2.4/buster/slim/Dockerfile +++ b/2.4/buster/slim/Dockerfile @@ -109,10 +109,11 @@ RUN set -eux; \ # install things globally, for great justice # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle +ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH ENV BUNDLE_PATH="$GEM_HOME" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" -ENV PATH $GEM_HOME/bin:$PATH +ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH # adjust permissions of a few directories for running "gem install" as an arbitrary user RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME" # (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both) diff --git a/2.4/stretch/Dockerfile b/2.4/stretch/Dockerfile index 20937aff2..7321ea9b0 100644 --- a/2.4/stretch/Dockerfile +++ b/2.4/stretch/Dockerfile @@ -83,10 +83,11 @@ RUN set -eux; \ # install things globally, for great justice # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle +ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH ENV BUNDLE_PATH="$GEM_HOME" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" -ENV PATH $GEM_HOME/bin:$PATH +ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH # adjust permissions of a few directories for running "gem install" as an arbitrary user RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME" # (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both) diff --git a/2.4/stretch/slim/Dockerfile b/2.4/stretch/slim/Dockerfile index 9db409eb7..aabd30346 100644 --- a/2.4/stretch/slim/Dockerfile +++ b/2.4/stretch/slim/Dockerfile @@ -108,10 +108,11 @@ RUN set -eux; \ # install things globally, for great justice # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle +ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH ENV BUNDLE_PATH="$GEM_HOME" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" -ENV PATH $GEM_HOME/bin:$PATH +ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH # adjust permissions of a few directories for running "gem install" as an arbitrary user RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME" # (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both) diff --git a/2.5/alpine3.10/Dockerfile b/2.5/alpine3.10/Dockerfile index bcd3fa1db..5175e0a32 100644 --- a/2.5/alpine3.10/Dockerfile +++ b/2.5/alpine3.10/Dockerfile @@ -124,10 +124,11 @@ RUN set -eux; \ # install things globally, for great justice # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle +ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH ENV BUNDLE_PATH="$GEM_HOME" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" -ENV PATH $GEM_HOME/bin:$PATH +ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH # adjust permissions of a few directories for running "gem install" as an arbitrary user RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME" # (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both) diff --git a/2.5/alpine3.11/Dockerfile b/2.5/alpine3.11/Dockerfile index ea601eb4a..b52762cac 100644 --- a/2.5/alpine3.11/Dockerfile +++ b/2.5/alpine3.11/Dockerfile @@ -124,10 +124,11 @@ RUN set -eux; \ # install things globally, for great justice # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle +ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH ENV BUNDLE_PATH="$GEM_HOME" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" -ENV PATH $GEM_HOME/bin:$PATH +ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH # adjust permissions of a few directories for running "gem install" as an arbitrary user RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME" # (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both) diff --git a/2.5/buster/Dockerfile b/2.5/buster/Dockerfile index 091480580..7e2b1ba01 100644 --- a/2.5/buster/Dockerfile +++ b/2.5/buster/Dockerfile @@ -83,10 +83,11 @@ RUN set -eux; \ # install things globally, for great justice # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle +ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH ENV BUNDLE_PATH="$GEM_HOME" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" -ENV PATH $GEM_HOME/bin:$PATH +ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH # adjust permissions of a few directories for running "gem install" as an arbitrary user RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME" # (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both) diff --git a/2.5/buster/slim/Dockerfile b/2.5/buster/slim/Dockerfile index 7e59996f1..b88a44721 100644 --- a/2.5/buster/slim/Dockerfile +++ b/2.5/buster/slim/Dockerfile @@ -109,10 +109,11 @@ RUN set -eux; \ # install things globally, for great justice # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle +ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH ENV BUNDLE_PATH="$GEM_HOME" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" -ENV PATH $GEM_HOME/bin:$PATH +ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH # adjust permissions of a few directories for running "gem install" as an arbitrary user RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME" # (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both) diff --git a/2.5/stretch/Dockerfile b/2.5/stretch/Dockerfile index fa5e92cb2..53d033686 100644 --- a/2.5/stretch/Dockerfile +++ b/2.5/stretch/Dockerfile @@ -83,10 +83,11 @@ RUN set -eux; \ # install things globally, for great justice # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle +ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH ENV BUNDLE_PATH="$GEM_HOME" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" -ENV PATH $GEM_HOME/bin:$PATH +ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH # adjust permissions of a few directories for running "gem install" as an arbitrary user RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME" # (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both) diff --git a/2.5/stretch/slim/Dockerfile b/2.5/stretch/slim/Dockerfile index 7977096b0..cc662a43f 100644 --- a/2.5/stretch/slim/Dockerfile +++ b/2.5/stretch/slim/Dockerfile @@ -108,10 +108,11 @@ RUN set -eux; \ # install things globally, for great justice # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle +ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH ENV BUNDLE_PATH="$GEM_HOME" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" -ENV PATH $GEM_HOME/bin:$PATH +ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH # adjust permissions of a few directories for running "gem install" as an arbitrary user RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME" # (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both) diff --git a/2.6/alpine3.10/Dockerfile b/2.6/alpine3.10/Dockerfile index 24548e138..ad381731f 100644 --- a/2.6/alpine3.10/Dockerfile +++ b/2.6/alpine3.10/Dockerfile @@ -120,10 +120,11 @@ RUN set -eux; \ # install things globally, for great justice # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle +ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH ENV BUNDLE_PATH="$GEM_HOME" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" -ENV PATH $GEM_HOME/bin:$PATH +ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH # adjust permissions of a few directories for running "gem install" as an arbitrary user RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME" # (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both) diff --git a/2.6/alpine3.11/Dockerfile b/2.6/alpine3.11/Dockerfile index 68e293a42..80a4896ca 100644 --- a/2.6/alpine3.11/Dockerfile +++ b/2.6/alpine3.11/Dockerfile @@ -120,10 +120,11 @@ RUN set -eux; \ # install things globally, for great justice # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle +ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH ENV BUNDLE_PATH="$GEM_HOME" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" -ENV PATH $GEM_HOME/bin:$PATH +ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH # adjust permissions of a few directories for running "gem install" as an arbitrary user RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME" # (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both) diff --git a/2.6/buster/Dockerfile b/2.6/buster/Dockerfile index 559a30e31..d51ee8641 100644 --- a/2.6/buster/Dockerfile +++ b/2.6/buster/Dockerfile @@ -79,10 +79,11 @@ RUN set -eux; \ # install things globally, for great justice # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle +ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH ENV BUNDLE_PATH="$GEM_HOME" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" -ENV PATH $GEM_HOME/bin:$PATH +ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH # adjust permissions of a few directories for running "gem install" as an arbitrary user RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME" # (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both) diff --git a/2.6/buster/slim/Dockerfile b/2.6/buster/slim/Dockerfile index afc80b3e1..94c9740bd 100644 --- a/2.6/buster/slim/Dockerfile +++ b/2.6/buster/slim/Dockerfile @@ -105,10 +105,11 @@ RUN set -eux; \ # install things globally, for great justice # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle +ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH ENV BUNDLE_PATH="$GEM_HOME" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" -ENV PATH $GEM_HOME/bin:$PATH +ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH # adjust permissions of a few directories for running "gem install" as an arbitrary user RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME" # (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both) diff --git a/2.6/stretch/Dockerfile b/2.6/stretch/Dockerfile index c0aa20580..15b3049bd 100644 --- a/2.6/stretch/Dockerfile +++ b/2.6/stretch/Dockerfile @@ -79,10 +79,11 @@ RUN set -eux; \ # install things globally, for great justice # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle +ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH ENV BUNDLE_PATH="$GEM_HOME" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" -ENV PATH $GEM_HOME/bin:$PATH +ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH # adjust permissions of a few directories for running "gem install" as an arbitrary user RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME" # (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both) diff --git a/2.6/stretch/slim/Dockerfile b/2.6/stretch/slim/Dockerfile index 845951c42..6e9bd98cc 100644 --- a/2.6/stretch/slim/Dockerfile +++ b/2.6/stretch/slim/Dockerfile @@ -104,10 +104,11 @@ RUN set -eux; \ # install things globally, for great justice # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle +ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH ENV BUNDLE_PATH="$GEM_HOME" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" -ENV PATH $GEM_HOME/bin:$PATH +ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH # adjust permissions of a few directories for running "gem install" as an arbitrary user RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME" # (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both) diff --git a/2.7/alpine3.10/Dockerfile b/2.7/alpine3.10/Dockerfile index 16818edb5..9fea344b0 100644 --- a/2.7/alpine3.10/Dockerfile +++ b/2.7/alpine3.10/Dockerfile @@ -120,10 +120,11 @@ RUN set -eux; \ # install things globally, for great justice # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle +ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH ENV BUNDLE_PATH="$GEM_HOME" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" -ENV PATH $GEM_HOME/bin:$PATH +ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH # adjust permissions of a few directories for running "gem install" as an arbitrary user RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME" # (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both) diff --git a/2.7/alpine3.11/Dockerfile b/2.7/alpine3.11/Dockerfile index 6368046c9..34197588b 100644 --- a/2.7/alpine3.11/Dockerfile +++ b/2.7/alpine3.11/Dockerfile @@ -120,10 +120,11 @@ RUN set -eux; \ # install things globally, for great justice # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle +ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH ENV BUNDLE_PATH="$GEM_HOME" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" -ENV PATH $GEM_HOME/bin:$PATH +ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH # adjust permissions of a few directories for running "gem install" as an arbitrary user RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME" # (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both) diff --git a/2.7/buster/Dockerfile b/2.7/buster/Dockerfile index 39d1f683f..53d79a952 100644 --- a/2.7/buster/Dockerfile +++ b/2.7/buster/Dockerfile @@ -79,10 +79,11 @@ RUN set -eux; \ # install things globally, for great justice # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle +ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH ENV BUNDLE_PATH="$GEM_HOME" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" -ENV PATH $GEM_HOME/bin:$PATH +ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH # adjust permissions of a few directories for running "gem install" as an arbitrary user RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME" # (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both) diff --git a/2.7/buster/slim/Dockerfile b/2.7/buster/slim/Dockerfile index 684ce5fb1..c7622cabc 100644 --- a/2.7/buster/slim/Dockerfile +++ b/2.7/buster/slim/Dockerfile @@ -105,10 +105,11 @@ RUN set -eux; \ # install things globally, for great justice # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle +ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH ENV BUNDLE_PATH="$GEM_HOME" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" -ENV PATH $GEM_HOME/bin:$PATH +ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH # adjust permissions of a few directories for running "gem install" as an arbitrary user RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME" # (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both) diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 46a46b9a3..e3c1aea53 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -124,10 +124,11 @@ RUN set -eux; \ # install things globally, for great justice # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle +ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH ENV BUNDLE_PATH="$GEM_HOME" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" -ENV PATH $GEM_HOME/bin:$PATH +ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH # adjust permissions of a few directories for running "gem install" as an arbitrary user RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME" # (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both) diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index 2cab186d9..7321e22dc 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -83,10 +83,11 @@ RUN set -eux; \ # install things globally, for great justice # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle +ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH ENV BUNDLE_PATH="$GEM_HOME" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" -ENV PATH $GEM_HOME/bin:$PATH +ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH # adjust permissions of a few directories for running "gem install" as an arbitrary user RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME" # (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both) diff --git a/Dockerfile-slim.template b/Dockerfile-slim.template index 0e7b0bdfb..95ff01a24 100644 --- a/Dockerfile-slim.template +++ b/Dockerfile-slim.template @@ -109,10 +109,11 @@ RUN set -eux; \ # install things globally, for great justice # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle +ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH ENV BUNDLE_PATH="$GEM_HOME" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" -ENV PATH $GEM_HOME/bin:$PATH +ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH # adjust permissions of a few directories for running "gem install" as an arbitrary user RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME" # (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both)