From 0c8dfb393e673884b44730c284171a9b947a061a Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Mon, 21 May 2018 12:34:41 -0700 Subject: [PATCH] Remove BUNDLE_BIN and add GEM_HOME/bin back to PATH See https://github.com/docker-library/ruby/pull/208#issuecomment-390755292 --- 2.2/alpine3.4/Dockerfile | 8 ++++---- 2.2/jessie/Dockerfile | 8 ++++---- 2.2/jessie/slim/Dockerfile | 8 ++++---- 2.3/alpine3.4/Dockerfile | 8 ++++---- 2.3/jessie/Dockerfile | 8 ++++---- 2.3/jessie/slim/Dockerfile | 8 ++++---- 2.3/stretch/Dockerfile | 8 ++++---- 2.3/stretch/slim/Dockerfile | 8 ++++---- 2.4/alpine3.4/Dockerfile | 8 ++++---- 2.4/alpine3.6/Dockerfile | 8 ++++---- 2.4/alpine3.7/Dockerfile | 8 ++++---- 2.4/jessie/Dockerfile | 8 ++++---- 2.4/jessie/slim/Dockerfile | 8 ++++---- 2.4/stretch/Dockerfile | 8 ++++---- 2.4/stretch/slim/Dockerfile | 8 ++++---- 2.5/alpine3.7/Dockerfile | 8 ++++---- 2.5/stretch/Dockerfile | 8 ++++---- 2.5/stretch/slim/Dockerfile | 8 ++++---- 2.6-rc/alpine3.7/Dockerfile | 8 ++++---- 2.6-rc/stretch/Dockerfile | 8 ++++---- 2.6-rc/stretch/slim/Dockerfile | 8 ++++---- Dockerfile-alpine.template | 8 ++++---- Dockerfile-debian.template | 8 ++++---- Dockerfile-slim.template | 8 ++++---- 24 files changed, 96 insertions(+), 96 deletions(-) diff --git a/2.2/alpine3.4/Dockerfile b/2.2/alpine3.4/Dockerfile index 6566155bb3..11f275a312 100644 --- a/2.2/alpine3.4/Dockerfile +++ b/2.2/alpine3.4/Dockerfile @@ -101,12 +101,12 @@ RUN set -ex \ # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle ENV BUNDLE_PATH="$GEM_HOME" \ - BUNDLE_BIN="$GEM_HOME/bin" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" # path recommendation: https://github.com/bundler/bundler/pull/6469#issuecomment-383235438 -ENV PATH $BUNDLE_PATH/gems/bin:$PATH -RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ - && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" +ENV PATH $GEM_HOME/bin:$BUNDLE_PATH/gems/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) CMD [ "irb" ] diff --git a/2.2/jessie/Dockerfile b/2.2/jessie/Dockerfile index 671f9c233b..a5645b2b92 100644 --- a/2.2/jessie/Dockerfile +++ b/2.2/jessie/Dockerfile @@ -66,12 +66,12 @@ RUN set -ex \ # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle ENV BUNDLE_PATH="$GEM_HOME" \ - BUNDLE_BIN="$GEM_HOME/bin" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" # path recommendation: https://github.com/bundler/bundler/pull/6469#issuecomment-383235438 -ENV PATH $BUNDLE_PATH/gems/bin:$PATH -RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ - && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" +ENV PATH $GEM_HOME/bin:$BUNDLE_PATH/gems/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) CMD [ "irb" ] diff --git a/2.2/jessie/slim/Dockerfile b/2.2/jessie/slim/Dockerfile index a3e2f9660e..658e227aa0 100644 --- a/2.2/jessie/slim/Dockerfile +++ b/2.2/jessie/slim/Dockerfile @@ -92,12 +92,12 @@ RUN set -ex \ # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle ENV BUNDLE_PATH="$GEM_HOME" \ - BUNDLE_BIN="$GEM_HOME/bin" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" # path recommendation: https://github.com/bundler/bundler/pull/6469#issuecomment-383235438 -ENV PATH $BUNDLE_PATH/gems/bin:$PATH -RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ - && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" +ENV PATH $GEM_HOME/bin:$BUNDLE_PATH/gems/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) CMD [ "irb" ] diff --git a/2.3/alpine3.4/Dockerfile b/2.3/alpine3.4/Dockerfile index c405e74166..aecc8f0947 100644 --- a/2.3/alpine3.4/Dockerfile +++ b/2.3/alpine3.4/Dockerfile @@ -101,12 +101,12 @@ RUN set -ex \ # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle ENV BUNDLE_PATH="$GEM_HOME" \ - BUNDLE_BIN="$GEM_HOME/bin" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" # path recommendation: https://github.com/bundler/bundler/pull/6469#issuecomment-383235438 -ENV PATH $BUNDLE_PATH/gems/bin:$PATH -RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ - && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" +ENV PATH $GEM_HOME/bin:$BUNDLE_PATH/gems/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) CMD [ "irb" ] diff --git a/2.3/jessie/Dockerfile b/2.3/jessie/Dockerfile index eace3b8c49..8a12e622b7 100644 --- a/2.3/jessie/Dockerfile +++ b/2.3/jessie/Dockerfile @@ -66,12 +66,12 @@ RUN set -ex \ # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle ENV BUNDLE_PATH="$GEM_HOME" \ - BUNDLE_BIN="$GEM_HOME/bin" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" # path recommendation: https://github.com/bundler/bundler/pull/6469#issuecomment-383235438 -ENV PATH $BUNDLE_PATH/gems/bin:$PATH -RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ - && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" +ENV PATH $GEM_HOME/bin:$BUNDLE_PATH/gems/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) CMD [ "irb" ] diff --git a/2.3/jessie/slim/Dockerfile b/2.3/jessie/slim/Dockerfile index 0de9a637c9..70939abf84 100644 --- a/2.3/jessie/slim/Dockerfile +++ b/2.3/jessie/slim/Dockerfile @@ -92,12 +92,12 @@ RUN set -ex \ # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle ENV BUNDLE_PATH="$GEM_HOME" \ - BUNDLE_BIN="$GEM_HOME/bin" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" # path recommendation: https://github.com/bundler/bundler/pull/6469#issuecomment-383235438 -ENV PATH $BUNDLE_PATH/gems/bin:$PATH -RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ - && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" +ENV PATH $GEM_HOME/bin:$BUNDLE_PATH/gems/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) CMD [ "irb" ] diff --git a/2.3/stretch/Dockerfile b/2.3/stretch/Dockerfile index ee6c536ce9..0f75c01fd7 100644 --- a/2.3/stretch/Dockerfile +++ b/2.3/stretch/Dockerfile @@ -68,12 +68,12 @@ RUN set -ex \ # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle ENV BUNDLE_PATH="$GEM_HOME" \ - BUNDLE_BIN="$GEM_HOME/bin" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" # path recommendation: https://github.com/bundler/bundler/pull/6469#issuecomment-383235438 -ENV PATH $BUNDLE_PATH/gems/bin:$PATH -RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ - && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" +ENV PATH $GEM_HOME/bin:$BUNDLE_PATH/gems/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) CMD [ "irb" ] diff --git a/2.3/stretch/slim/Dockerfile b/2.3/stretch/slim/Dockerfile index 3dbfc7f760..2b4e438c2b 100644 --- a/2.3/stretch/slim/Dockerfile +++ b/2.3/stretch/slim/Dockerfile @@ -92,12 +92,12 @@ RUN set -ex \ # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle ENV BUNDLE_PATH="$GEM_HOME" \ - BUNDLE_BIN="$GEM_HOME/bin" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" # path recommendation: https://github.com/bundler/bundler/pull/6469#issuecomment-383235438 -ENV PATH $BUNDLE_PATH/gems/bin:$PATH -RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ - && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" +ENV PATH $GEM_HOME/bin:$BUNDLE_PATH/gems/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) CMD [ "irb" ] diff --git a/2.4/alpine3.4/Dockerfile b/2.4/alpine3.4/Dockerfile index c85050bfb5..37d67d04e0 100644 --- a/2.4/alpine3.4/Dockerfile +++ b/2.4/alpine3.4/Dockerfile @@ -101,12 +101,12 @@ RUN set -ex \ # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle ENV BUNDLE_PATH="$GEM_HOME" \ - BUNDLE_BIN="$GEM_HOME/bin" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" # path recommendation: https://github.com/bundler/bundler/pull/6469#issuecomment-383235438 -ENV PATH $BUNDLE_PATH/gems/bin:$PATH -RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ - && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" +ENV PATH $GEM_HOME/bin:$BUNDLE_PATH/gems/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) CMD [ "irb" ] diff --git a/2.4/alpine3.6/Dockerfile b/2.4/alpine3.6/Dockerfile index d6071461e9..d6dc0462a6 100644 --- a/2.4/alpine3.6/Dockerfile +++ b/2.4/alpine3.6/Dockerfile @@ -101,12 +101,12 @@ RUN set -ex \ # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle ENV BUNDLE_PATH="$GEM_HOME" \ - BUNDLE_BIN="$GEM_HOME/bin" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" # path recommendation: https://github.com/bundler/bundler/pull/6469#issuecomment-383235438 -ENV PATH $BUNDLE_PATH/gems/bin:$PATH -RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ - && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" +ENV PATH $GEM_HOME/bin:$BUNDLE_PATH/gems/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) CMD [ "irb" ] diff --git a/2.4/alpine3.7/Dockerfile b/2.4/alpine3.7/Dockerfile index 8bf6723afb..4b0dd8205a 100644 --- a/2.4/alpine3.7/Dockerfile +++ b/2.4/alpine3.7/Dockerfile @@ -101,12 +101,12 @@ RUN set -ex \ # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle ENV BUNDLE_PATH="$GEM_HOME" \ - BUNDLE_BIN="$GEM_HOME/bin" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" # path recommendation: https://github.com/bundler/bundler/pull/6469#issuecomment-383235438 -ENV PATH $BUNDLE_PATH/gems/bin:$PATH -RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ - && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" +ENV PATH $GEM_HOME/bin:$BUNDLE_PATH/gems/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) CMD [ "irb" ] diff --git a/2.4/jessie/Dockerfile b/2.4/jessie/Dockerfile index 591d088a31..de82348f3b 100644 --- a/2.4/jessie/Dockerfile +++ b/2.4/jessie/Dockerfile @@ -66,12 +66,12 @@ RUN set -ex \ # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle ENV BUNDLE_PATH="$GEM_HOME" \ - BUNDLE_BIN="$GEM_HOME/bin" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" # path recommendation: https://github.com/bundler/bundler/pull/6469#issuecomment-383235438 -ENV PATH $BUNDLE_PATH/gems/bin:$PATH -RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ - && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" +ENV PATH $GEM_HOME/bin:$BUNDLE_PATH/gems/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) CMD [ "irb" ] diff --git a/2.4/jessie/slim/Dockerfile b/2.4/jessie/slim/Dockerfile index 190c973ec2..92842cc513 100644 --- a/2.4/jessie/slim/Dockerfile +++ b/2.4/jessie/slim/Dockerfile @@ -92,12 +92,12 @@ RUN set -ex \ # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle ENV BUNDLE_PATH="$GEM_HOME" \ - BUNDLE_BIN="$GEM_HOME/bin" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" # path recommendation: https://github.com/bundler/bundler/pull/6469#issuecomment-383235438 -ENV PATH $BUNDLE_PATH/gems/bin:$PATH -RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ - && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" +ENV PATH $GEM_HOME/bin:$BUNDLE_PATH/gems/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) CMD [ "irb" ] diff --git a/2.4/stretch/Dockerfile b/2.4/stretch/Dockerfile index cc08911031..34899060d2 100644 --- a/2.4/stretch/Dockerfile +++ b/2.4/stretch/Dockerfile @@ -66,12 +66,12 @@ RUN set -ex \ # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle ENV BUNDLE_PATH="$GEM_HOME" \ - BUNDLE_BIN="$GEM_HOME/bin" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" # path recommendation: https://github.com/bundler/bundler/pull/6469#issuecomment-383235438 -ENV PATH $BUNDLE_PATH/gems/bin:$PATH -RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ - && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" +ENV PATH $GEM_HOME/bin:$BUNDLE_PATH/gems/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) CMD [ "irb" ] diff --git a/2.4/stretch/slim/Dockerfile b/2.4/stretch/slim/Dockerfile index ac2b07fd0f..a2d97467de 100644 --- a/2.4/stretch/slim/Dockerfile +++ b/2.4/stretch/slim/Dockerfile @@ -92,12 +92,12 @@ RUN set -ex \ # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle ENV BUNDLE_PATH="$GEM_HOME" \ - BUNDLE_BIN="$GEM_HOME/bin" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" # path recommendation: https://github.com/bundler/bundler/pull/6469#issuecomment-383235438 -ENV PATH $BUNDLE_PATH/gems/bin:$PATH -RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ - && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" +ENV PATH $GEM_HOME/bin:$BUNDLE_PATH/gems/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) CMD [ "irb" ] diff --git a/2.5/alpine3.7/Dockerfile b/2.5/alpine3.7/Dockerfile index 71725f3db4..d80296285d 100644 --- a/2.5/alpine3.7/Dockerfile +++ b/2.5/alpine3.7/Dockerfile @@ -101,12 +101,12 @@ RUN set -ex \ # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle ENV BUNDLE_PATH="$GEM_HOME" \ - BUNDLE_BIN="$GEM_HOME/bin" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" # path recommendation: https://github.com/bundler/bundler/pull/6469#issuecomment-383235438 -ENV PATH $BUNDLE_PATH/gems/bin:$PATH -RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ - && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" +ENV PATH $GEM_HOME/bin:$BUNDLE_PATH/gems/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) CMD [ "irb" ] diff --git a/2.5/stretch/Dockerfile b/2.5/stretch/Dockerfile index c654d97eba..14d8198af1 100644 --- a/2.5/stretch/Dockerfile +++ b/2.5/stretch/Dockerfile @@ -66,12 +66,12 @@ RUN set -ex \ # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle ENV BUNDLE_PATH="$GEM_HOME" \ - BUNDLE_BIN="$GEM_HOME/bin" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" # path recommendation: https://github.com/bundler/bundler/pull/6469#issuecomment-383235438 -ENV PATH $BUNDLE_PATH/gems/bin:$PATH -RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ - && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" +ENV PATH $GEM_HOME/bin:$BUNDLE_PATH/gems/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) CMD [ "irb" ] diff --git a/2.5/stretch/slim/Dockerfile b/2.5/stretch/slim/Dockerfile index c80c031db7..8a71a2e25b 100644 --- a/2.5/stretch/slim/Dockerfile +++ b/2.5/stretch/slim/Dockerfile @@ -92,12 +92,12 @@ RUN set -ex \ # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle ENV BUNDLE_PATH="$GEM_HOME" \ - BUNDLE_BIN="$GEM_HOME/bin" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" # path recommendation: https://github.com/bundler/bundler/pull/6469#issuecomment-383235438 -ENV PATH $BUNDLE_PATH/gems/bin:$PATH -RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ - && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" +ENV PATH $GEM_HOME/bin:$BUNDLE_PATH/gems/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) CMD [ "irb" ] diff --git a/2.6-rc/alpine3.7/Dockerfile b/2.6-rc/alpine3.7/Dockerfile index 42e029b4de..a3f9ada1c6 100644 --- a/2.6-rc/alpine3.7/Dockerfile +++ b/2.6-rc/alpine3.7/Dockerfile @@ -101,12 +101,12 @@ RUN set -ex \ # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle ENV BUNDLE_PATH="$GEM_HOME" \ - BUNDLE_BIN="$GEM_HOME/bin" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" # path recommendation: https://github.com/bundler/bundler/pull/6469#issuecomment-383235438 -ENV PATH $BUNDLE_PATH/gems/bin:$PATH -RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ - && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" +ENV PATH $GEM_HOME/bin:$BUNDLE_PATH/gems/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) CMD [ "irb" ] diff --git a/2.6-rc/stretch/Dockerfile b/2.6-rc/stretch/Dockerfile index 34c2178b4f..6ba905b7c5 100644 --- a/2.6-rc/stretch/Dockerfile +++ b/2.6-rc/stretch/Dockerfile @@ -66,12 +66,12 @@ RUN set -ex \ # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle ENV BUNDLE_PATH="$GEM_HOME" \ - BUNDLE_BIN="$GEM_HOME/bin" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" # path recommendation: https://github.com/bundler/bundler/pull/6469#issuecomment-383235438 -ENV PATH $BUNDLE_PATH/gems/bin:$PATH -RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ - && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" +ENV PATH $GEM_HOME/bin:$BUNDLE_PATH/gems/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) CMD [ "irb" ] diff --git a/2.6-rc/stretch/slim/Dockerfile b/2.6-rc/stretch/slim/Dockerfile index 26af3b352c..e687be268f 100644 --- a/2.6-rc/stretch/slim/Dockerfile +++ b/2.6-rc/stretch/slim/Dockerfile @@ -92,12 +92,12 @@ RUN set -ex \ # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle ENV BUNDLE_PATH="$GEM_HOME" \ - BUNDLE_BIN="$GEM_HOME/bin" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" # path recommendation: https://github.com/bundler/bundler/pull/6469#issuecomment-383235438 -ENV PATH $BUNDLE_PATH/gems/bin:$PATH -RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ - && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" +ENV PATH $GEM_HOME/bin:$BUNDLE_PATH/gems/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) CMD [ "irb" ] diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 1d0f9e0ef5..4a75626e5f 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -101,12 +101,12 @@ RUN set -ex \ # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle ENV BUNDLE_PATH="$GEM_HOME" \ - BUNDLE_BIN="$GEM_HOME/bin" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" # path recommendation: https://github.com/bundler/bundler/pull/6469#issuecomment-383235438 -ENV PATH $BUNDLE_PATH/gems/bin:$PATH -RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ - && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" +ENV PATH $GEM_HOME/bin:$BUNDLE_PATH/gems/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) CMD [ "irb" ] diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index ee05fcc0b0..3eb568b968 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -68,12 +68,12 @@ RUN set -ex \ # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle ENV BUNDLE_PATH="$GEM_HOME" \ - BUNDLE_BIN="$GEM_HOME/bin" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" # path recommendation: https://github.com/bundler/bundler/pull/6469#issuecomment-383235438 -ENV PATH $BUNDLE_PATH/gems/bin:$PATH -RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ - && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" +ENV PATH $GEM_HOME/bin:$BUNDLE_PATH/gems/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) CMD [ "irb" ] diff --git a/Dockerfile-slim.template b/Dockerfile-slim.template index 8b0038c72e..3c2846a417 100644 --- a/Dockerfile-slim.template +++ b/Dockerfile-slim.template @@ -92,12 +92,12 @@ RUN set -ex \ # and don't create ".bundle" in all our apps ENV GEM_HOME /usr/local/bundle ENV BUNDLE_PATH="$GEM_HOME" \ - BUNDLE_BIN="$GEM_HOME/bin" \ BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" # path recommendation: https://github.com/bundler/bundler/pull/6469#issuecomment-383235438 -ENV PATH $BUNDLE_PATH/gems/bin:$PATH -RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ - && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" +ENV PATH $GEM_HOME/bin:$BUNDLE_PATH/gems/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) CMD [ "irb" ]