Skip to content

Commit 82eecb7

Browse files
Alternative fix
Stop setting `BUNDLE_PATH`. All default bundler versions shipped with all supported rubies install gems to `GEM_HOME` by default, so this shouldn't be a breaking change and it's a less surprising behavior because it does not deviate from how bundler is configured by default. Future versions will probably install locally by default, but that hasn't happened yet. I think leaving bundler "unconfigured" also matches the direction of the recent change where the images no longer explicitly install `bundler` but simply leave whatever version comes with ruby. Similarly, it makes sense to me to leave whatever configuration comes by default with `bundler` in place.
1 parent 7df74ad commit 82eecb7

File tree

25 files changed

+75
-175
lines changed

25 files changed

+75
-175
lines changed

2.4/alpine3.10/Dockerfile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,12 @@ RUN set -eux; \
121121
gem --version; \
122122
bundle --version
123123

124-
# install things globally, for great justice
125-
# and don't create ".bundle" in all our apps
124+
# don't create ".bundle" in all our apps
126125
ENV GEM_HOME /usr/local/bundle
127-
ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH
128-
ENV BUNDLE_PATH="$GEM_HOME" \
129-
BUNDLE_SILENCE_ROOT_WARNING=1 \
126+
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \
130127
BUNDLE_APP_CONFIG="$GEM_HOME"
131-
ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH
128+
ENV PATH $GEM_HOME/bin:$PATH
132129
# adjust permissions of a few directories for running "gem install" as an arbitrary user
133130
RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME"
134-
# (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both)
135131

136132
CMD [ "irb" ]

2.4/alpine3.11/Dockerfile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,12 @@ RUN set -eux; \
121121
gem --version; \
122122
bundle --version
123123

124-
# install things globally, for great justice
125-
# and don't create ".bundle" in all our apps
124+
# don't create ".bundle" in all our apps
126125
ENV GEM_HOME /usr/local/bundle
127-
ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH
128-
ENV BUNDLE_PATH="$GEM_HOME" \
129-
BUNDLE_SILENCE_ROOT_WARNING=1 \
126+
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \
130127
BUNDLE_APP_CONFIG="$GEM_HOME"
131-
ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH
128+
ENV PATH $GEM_HOME/bin:$PATH
132129
# adjust permissions of a few directories for running "gem install" as an arbitrary user
133130
RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME"
134-
# (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both)
135131

136132
CMD [ "irb" ]

2.4/buster/Dockerfile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,12 @@ RUN set -eux; \
8080
gem --version; \
8181
bundle --version
8282

83-
# install things globally, for great justice
84-
# and don't create ".bundle" in all our apps
83+
# don't create ".bundle" in all our apps
8584
ENV GEM_HOME /usr/local/bundle
86-
ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH
87-
ENV BUNDLE_PATH="$GEM_HOME" \
88-
BUNDLE_SILENCE_ROOT_WARNING=1 \
85+
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \
8986
BUNDLE_APP_CONFIG="$GEM_HOME"
90-
ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH
87+
ENV PATH $GEM_HOME/bin:$PATH
9188
# adjust permissions of a few directories for running "gem install" as an arbitrary user
9289
RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME"
93-
# (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both)
9490

9591
CMD [ "irb" ]

2.4/buster/slim/Dockerfile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,12 @@ RUN set -eux; \
106106
gem --version; \
107107
bundle --version
108108

109-
# install things globally, for great justice
110-
# and don't create ".bundle" in all our apps
109+
# don't create ".bundle" in all our apps
111110
ENV GEM_HOME /usr/local/bundle
112-
ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH
113-
ENV BUNDLE_PATH="$GEM_HOME" \
114-
BUNDLE_SILENCE_ROOT_WARNING=1 \
111+
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \
115112
BUNDLE_APP_CONFIG="$GEM_HOME"
116-
ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH
113+
ENV PATH $GEM_HOME/bin:$PATH
117114
# adjust permissions of a few directories for running "gem install" as an arbitrary user
118115
RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME"
119-
# (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both)
120116

121117
CMD [ "irb" ]

2.4/stretch/Dockerfile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,12 @@ RUN set -eux; \
8080
gem --version; \
8181
bundle --version
8282

83-
# install things globally, for great justice
84-
# and don't create ".bundle" in all our apps
83+
# don't create ".bundle" in all our apps
8584
ENV GEM_HOME /usr/local/bundle
86-
ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH
87-
ENV BUNDLE_PATH="$GEM_HOME" \
88-
BUNDLE_SILENCE_ROOT_WARNING=1 \
85+
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \
8986
BUNDLE_APP_CONFIG="$GEM_HOME"
90-
ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH
87+
ENV PATH $GEM_HOME/bin:$PATH
9188
# adjust permissions of a few directories for running "gem install" as an arbitrary user
9289
RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME"
93-
# (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both)
9490

9591
CMD [ "irb" ]

2.4/stretch/slim/Dockerfile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,12 @@ RUN set -eux; \
105105
gem --version; \
106106
bundle --version
107107

108-
# install things globally, for great justice
109-
# and don't create ".bundle" in all our apps
108+
# don't create ".bundle" in all our apps
110109
ENV GEM_HOME /usr/local/bundle
111-
ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH
112-
ENV BUNDLE_PATH="$GEM_HOME" \
113-
BUNDLE_SILENCE_ROOT_WARNING=1 \
110+
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \
114111
BUNDLE_APP_CONFIG="$GEM_HOME"
115-
ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH
112+
ENV PATH $GEM_HOME/bin:$PATH
116113
# adjust permissions of a few directories for running "gem install" as an arbitrary user
117114
RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME"
118-
# (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both)
119115

120116
CMD [ "irb" ]

2.5/alpine3.10/Dockerfile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,12 @@ RUN set -eux; \
121121
gem --version; \
122122
bundle --version
123123

124-
# install things globally, for great justice
125-
# and don't create ".bundle" in all our apps
124+
# don't create ".bundle" in all our apps
126125
ENV GEM_HOME /usr/local/bundle
127-
ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH
128-
ENV BUNDLE_PATH="$GEM_HOME" \
129-
BUNDLE_SILENCE_ROOT_WARNING=1 \
126+
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \
130127
BUNDLE_APP_CONFIG="$GEM_HOME"
131-
ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH
128+
ENV PATH $GEM_HOME/bin:$PATH
132129
# adjust permissions of a few directories for running "gem install" as an arbitrary user
133130
RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME"
134-
# (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both)
135131

136132
CMD [ "irb" ]

2.5/alpine3.11/Dockerfile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,12 @@ RUN set -eux; \
121121
gem --version; \
122122
bundle --version
123123

124-
# install things globally, for great justice
125-
# and don't create ".bundle" in all our apps
124+
# don't create ".bundle" in all our apps
126125
ENV GEM_HOME /usr/local/bundle
127-
ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH
128-
ENV BUNDLE_PATH="$GEM_HOME" \
129-
BUNDLE_SILENCE_ROOT_WARNING=1 \
126+
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \
130127
BUNDLE_APP_CONFIG="$GEM_HOME"
131-
ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH
128+
ENV PATH $GEM_HOME/bin:$PATH
132129
# adjust permissions of a few directories for running "gem install" as an arbitrary user
133130
RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME"
134-
# (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both)
135131

136132
CMD [ "irb" ]

2.5/buster/Dockerfile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,12 @@ RUN set -eux; \
8080
gem --version; \
8181
bundle --version
8282

83-
# install things globally, for great justice
84-
# and don't create ".bundle" in all our apps
83+
# don't create ".bundle" in all our apps
8584
ENV GEM_HOME /usr/local/bundle
86-
ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH
87-
ENV BUNDLE_PATH="$GEM_HOME" \
88-
BUNDLE_SILENCE_ROOT_WARNING=1 \
85+
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \
8986
BUNDLE_APP_CONFIG="$GEM_HOME"
90-
ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH
87+
ENV PATH $GEM_HOME/bin:$PATH
9188
# adjust permissions of a few directories for running "gem install" as an arbitrary user
9289
RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME"
93-
# (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both)
9490

9591
CMD [ "irb" ]

2.5/buster/slim/Dockerfile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,12 @@ RUN set -eux; \
106106
gem --version; \
107107
bundle --version
108108

109-
# install things globally, for great justice
110-
# and don't create ".bundle" in all our apps
109+
# don't create ".bundle" in all our apps
111110
ENV GEM_HOME /usr/local/bundle
112-
ENV GEM_PATH $GEM_HOME/ruby/$RUBY_MAJOR.0:$GEM_PATH
113-
ENV BUNDLE_PATH="$GEM_HOME" \
114-
BUNDLE_SILENCE_ROOT_WARNING=1 \
111+
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \
115112
BUNDLE_APP_CONFIG="$GEM_HOME"
116-
ENV PATH $GEM_HOME/bin:$GEM_HOME/ruby/$RUBY_MAJOR.0/bin:$PATH
113+
ENV PATH $GEM_HOME/bin:$PATH
117114
# adjust permissions of a few directories for running "gem install" as an arbitrary user
118115
RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME"
119-
# (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both)
120116

121117
CMD [ "irb" ]

0 commit comments

Comments
 (0)