diff --git a/2.3/alpine3.7/Dockerfile b/2.3/alpine3.7/Dockerfile index 12c841b10..2853a4ce5 100644 --- a/2.3/alpine3.7/Dockerfile +++ b/2.3/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.3/jessie/Dockerfile b/2.3/jessie/Dockerfile index eace3b8c4..8a12e622b 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 0de9a637c..70939abf8 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 ee6c536ce..0f75c01fd 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 3dbfc7f76..2b4e438c2 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.6/Dockerfile b/2.4/alpine3.6/Dockerfile index d6071461e..d6dc0462a 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 8bf6723af..4b0dd8205 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 591d088a3..de82348f3 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 190c973ec..92842cc51 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 cc0891103..34899060d 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 ac2b07fd0..a2d97467d 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 71725f3db..d80296285 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 c654d97eb..14d8198af 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 c80c031db..8a71a2e25 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 42e029b4d..a3f9ada1c 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 34c2178b4..6ba905b7c 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 26af3b352..e687be268 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 1d0f9e0ef..4a75626e5 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 ee05fcc0b..3eb568b96 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 8b0038c72..3c2846a41 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" ]