Skip to content

Commit cffc75a

Browse files
committed
Remove BUNDLE_BIN
`BUNDLE_BIN` is a path that is supposed to be specific to a given bundle. As such it cannot and shoudl not be reused. This manifests as bundle-specific path entries being hardcoded in scripts of a potentially shared `bin` folder. As a consequence the scripts can fail unless paths happen to be identical by sheer coincidence.
1 parent cbc7169 commit cffc75a

File tree

15 files changed

+103
-134
lines changed

15 files changed

+103
-134
lines changed

src/engines/jruby/9.2/Dockerfile.gnu

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,15 @@ ENV PATH /opt/jruby/bin:$PATH
5959
RUN mkdir -p /opt/jruby/etc \
6060
&& echo -e 'install: --no-document\nupdate: --no-document' >> /opt/jruby/etc/gemrc
6161

62-
# Install things at a specific path and create ".bundle" in there as well:
63-
# This prevents pollution of an app volume and makes the bundle path mountable
64-
# as a volume as well.
62+
63+
# don't create ".bundle" in all our apps
6564
ENV GEM_HOME /usr/local/bundle
66-
ENV BUNDLE_BIN="$GEM_HOME/bin" \
67-
BUNDLE_SILENCE_ROOT_WARNING=1 \
65+
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \
6866
BUNDLE_APP_CONFIG="$GEM_HOME"
69-
ENV PATH $BUNDLE_BIN:$PATH
70-
RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
71-
&& chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
67+
ENV PATH $GEM_HOME/bin:$PATH
68+
69+
# adjust permissions of a few directories for running "gem install" as an arbitrary user
70+
RUN mkdir -p "$GEM_HOME" && chmod 1777 "$GEM_HOME"
7271

7372
## Install a pinned RubyGems and Bundler
7473
RUN gem update --system 3.3.26

src/engines/jruby/9.3/Dockerfile.gnu

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,14 @@ ENV PATH /opt/jruby/bin:$PATH
5959
RUN mkdir -p /opt/jruby/etc \
6060
&& echo -e 'install: --no-document\nupdate: --no-document' >> /opt/jruby/etc/gemrc
6161

62-
# Install things at a specific path and create ".bundle" in there as well:
63-
# This prevents pollution of an app volume and makes the bundle path mountable
64-
# as a volume as well.
62+
# don't create ".bundle" in all our apps
6563
ENV GEM_HOME /usr/local/bundle
66-
ENV BUNDLE_BIN="$GEM_HOME/bin" \
67-
BUNDLE_SILENCE_ROOT_WARNING=1 \
64+
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \
6865
BUNDLE_APP_CONFIG="$GEM_HOME"
69-
ENV PATH $BUNDLE_BIN:$PATH
70-
RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
71-
&& chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
66+
ENV PATH $GEM_HOME/bin:$PATH
67+
68+
# adjust permissions of a few directories for running "gem install" as an arbitrary user
69+
RUN mkdir -p "$GEM_HOME" && chmod 1777 "$GEM_HOME"
7270

7371
## Install a pinned RubyGems and Bundler
7472
RUN gem update --system 3.3.26

src/engines/jruby/9.4/Dockerfile.gnu

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,14 @@ ENV PATH /opt/jruby/bin:$PATH
5959
RUN mkdir -p /opt/jruby/etc \
6060
&& echo -e 'install: --no-document\nupdate: --no-document' >> /opt/jruby/etc/gemrc
6161

62-
# Install things at a specific path and create ".bundle" in there as well:
63-
# This prevents pollution of an app volume and makes the bundle path mountable
64-
# as a volume as well.
62+
# don't create ".bundle" in all our apps
6563
ENV GEM_HOME /usr/local/bundle
66-
ENV BUNDLE_BIN="$GEM_HOME/bin" \
67-
BUNDLE_SILENCE_ROOT_WARNING=1 \
64+
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \
6865
BUNDLE_APP_CONFIG="$GEM_HOME"
69-
ENV PATH $BUNDLE_BIN:$PATH
70-
RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
71-
&& chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
66+
ENV PATH $GEM_HOME/bin:$PATH
67+
68+
# adjust permissions of a few directories for running "gem install" as an arbitrary user
69+
RUN mkdir -p "$GEM_HOME" && chmod 1777 "$GEM_HOME"
7270

7371
## Install a pinned RubyGems and Bundler
7472
RUN gem update --system 3.5.21

src/engines/ruby/2.1/Dockerfile.gnu

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,14 @@ RUN set -ex \
8888
# && gem install bundler --version "$BUNDLER_VERSION" --force \
8989
# && rm -r /root/.gem/
9090

91-
# install things globally, for great justice
92-
# and don't create ".bundle" in all our apps
91+
# don't create ".bundle" in all our apps
9392
ENV GEM_HOME /usr/local/bundle
94-
ENV BUNDLE_BIN="$GEM_HOME/bin" \
95-
BUNDLE_SILENCE_ROOT_WARNING=1 \
93+
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \
9694
BUNDLE_APP_CONFIG="$GEM_HOME"
97-
ENV PATH $BUNDLE_BIN:$PATH
98-
RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
99-
&& chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
95+
ENV PATH $GEM_HOME/bin:$PATH
96+
97+
# adjust permissions of a few directories for running "gem install" as an arbitrary user
98+
RUN mkdir -p "$GEM_HOME" && chmod 1777 "$GEM_HOME"
10099

101100
CMD [ "irb" ]
102101

@@ -144,16 +143,14 @@ ENV LANGUAGE en_US:en
144143
# Ensure consistent timezone
145144
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime
146145

147-
# Install things at a specific path and create ".bundle" in there as well:
148-
# This prevents pollution of an app volume and makes the bundle path mountable
149-
# as a volume as well.
146+
# don't create ".bundle" in all our apps
150147
ENV GEM_HOME /usr/local/bundle
151-
ENV BUNDLE_BIN="$GEM_HOME/bin" \
152-
BUNDLE_SILENCE_ROOT_WARNING=1 \
148+
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \
153149
BUNDLE_APP_CONFIG="$GEM_HOME"
154-
ENV PATH $BUNDLE_BIN:$PATH
155-
RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
156-
&& chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
150+
ENV PATH $GEM_HOME/bin:$PATH
151+
152+
# adjust permissions of a few directories for running "gem install" as an arbitrary user
153+
RUN mkdir -p "$GEM_HOME" && chmod 1777 "$GEM_HOME"
157154

158155
## Install a pinned RubyGems and Bundler
159156
RUN gem update --system 2.7.11

src/engines/ruby/2.2/Dockerfile.gnu

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,14 @@ RUN set -ex \
9292
# && gem install bundler --version "$BUNDLER_VERSION" --force \
9393
# && rm -r /root/.gem/
9494

95-
# install things globally, for great justice
96-
# and don't create ".bundle" in all our apps
95+
# don't create ".bundle" in all our apps
9796
ENV GEM_HOME /usr/local/bundle
98-
ENV BUNDLE_BIN="$GEM_HOME/bin" \
99-
BUNDLE_SILENCE_ROOT_WARNING=1 \
97+
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \
10098
BUNDLE_APP_CONFIG="$GEM_HOME"
101-
ENV PATH $BUNDLE_BIN:$PATH
102-
RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
103-
&& chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
99+
ENV PATH $GEM_HOME/bin:$PATH
100+
101+
# adjust permissions of a few directories for running "gem install" as an arbitrary user
102+
RUN mkdir -p "$GEM_HOME" && chmod 1777 "$GEM_HOME"
104103

105104
CMD [ "irb" ]
106105

@@ -148,16 +147,14 @@ ENV LANGUAGE en_US:en
148147
# Ensure consistent timezone
149148
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime
150149

151-
# Install things at a specific path and create ".bundle" in there as well:
152-
# This prevents pollution of an app volume and makes the bundle path mountable
153-
# as a volume as well.
150+
# don't create ".bundle" in all our apps
154151
ENV GEM_HOME /usr/local/bundle
155-
ENV BUNDLE_BIN="$GEM_HOME/bin" \
156-
BUNDLE_SILENCE_ROOT_WARNING=1 \
152+
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \
157153
BUNDLE_APP_CONFIG="$GEM_HOME"
158-
ENV PATH $BUNDLE_BIN:$PATH
159-
RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
160-
&& chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
154+
ENV PATH $GEM_HOME/bin:$PATH
155+
156+
# adjust permissions of a few directories for running "gem install" as an arbitrary user
157+
RUN mkdir -p "$GEM_HOME" && chmod 1777 "$GEM_HOME"
161158

162159
## Install a pinned RubyGems and Bundler
163160
RUN gem update --system 2.7.11

src/engines/ruby/2.3/Dockerfile.gnu

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,14 @@ ENV LANGUAGE en_US:en
4949
# Ensure consistent timezone
5050
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime
5151

52-
# Install things at a specific path and create ".bundle" in there as well:
53-
# This prevents pollution of an app volume and makes the bundle path mountable
54-
# as a volume as well.
52+
# don't create ".bundle" in all our apps
5553
ENV GEM_HOME /usr/local/bundle
56-
ENV BUNDLE_BIN="$GEM_HOME/bin" \
57-
BUNDLE_SILENCE_ROOT_WARNING=1 \
54+
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \
5855
BUNDLE_APP_CONFIG="$GEM_HOME"
59-
ENV PATH $BUNDLE_BIN:$PATH
60-
RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
61-
&& chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
56+
ENV PATH $GEM_HOME/bin:$PATH
57+
58+
# adjust permissions of a few directories for running "gem install" as an arbitrary user
59+
RUN mkdir -p "$GEM_HOME" && chmod 1777 "$GEM_HOME"
6260

6361
## Install a pinned RubyGems and Bundler
6462
RUN gem update --system 3.3.26

src/engines/ruby/2.4/Dockerfile.gnu

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,14 @@ ENV LANGUAGE en_US:en
4545
# Ensure consistent timezone
4646
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime
4747

48-
# Install things at a specific path and create ".bundle" in there as well:
49-
# This prevents pollution of an app volume and makes the bundle path mountable
50-
# as a volume as well.
48+
# don't create ".bundle" in all our apps
5149
ENV GEM_HOME /usr/local/bundle
52-
ENV BUNDLE_BIN="$GEM_HOME/bin" \
53-
BUNDLE_SILENCE_ROOT_WARNING=1 \
50+
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \
5451
BUNDLE_APP_CONFIG="$GEM_HOME"
55-
ENV PATH $BUNDLE_BIN:$PATH
56-
RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
57-
&& chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
52+
ENV PATH $GEM_HOME/bin:$PATH
53+
54+
# adjust permissions of a few directories for running "gem install" as an arbitrary user
55+
RUN mkdir -p "$GEM_HOME" && chmod 1777 "$GEM_HOME"
5856

5957
## Install a pinned RubyGems and Bundler
6058
RUN gem update --system 3.3.26

src/engines/ruby/2.5/Dockerfile.gnu

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,14 @@ ENV LANGUAGE en_US:en
4545
# Ensure consistent timezone
4646
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime
4747

48-
# Install things at a specific path and create ".bundle" in there as well:
49-
# This prevents pollution of an app volume and makes the bundle path mountable
50-
# as a volume as well.
48+
# don't create ".bundle" in all our apps
5149
ENV GEM_HOME /usr/local/bundle
52-
ENV BUNDLE_BIN="$GEM_HOME/bin" \
53-
BUNDLE_SILENCE_ROOT_WARNING=1 \
50+
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \
5451
BUNDLE_APP_CONFIG="$GEM_HOME"
55-
ENV PATH $BUNDLE_BIN:$PATH
56-
RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
57-
&& chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
52+
ENV PATH $GEM_HOME/bin:$PATH
53+
54+
# adjust permissions of a few directories for running "gem install" as an arbitrary user
55+
RUN mkdir -p "$GEM_HOME" && chmod 1777 "$GEM_HOME"
5856

5957
## Install a pinned RubyGems and Bundler
6058
RUN gem update --system 3.3.26

src/engines/ruby/2.6/Dockerfile.gnu

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,14 @@ ENV LANGUAGE en_US:en
4545
# Ensure consistent timezone
4646
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime
4747

48-
# Install things at a specific path and create ".bundle" in there as well:
49-
# This prevents pollution of an app volume and makes the bundle path mountable
50-
# as a volume as well.
48+
# don't create ".bundle" in all our apps
5149
ENV GEM_HOME /usr/local/bundle
52-
ENV BUNDLE_BIN="$GEM_HOME/bin" \
53-
BUNDLE_SILENCE_ROOT_WARNING=1 \
50+
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \
5451
BUNDLE_APP_CONFIG="$GEM_HOME"
55-
ENV PATH $BUNDLE_BIN:$PATH
56-
RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
57-
&& chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
52+
ENV PATH $GEM_HOME/bin:$PATH
53+
54+
# adjust permissions of a few directories for running "gem install" as an arbitrary user
55+
RUN mkdir -p "$GEM_HOME" && chmod 1777 "$GEM_HOME"
5856

5957
## Install a pinned RubyGems and Bundler
6058
RUN gem update --system 3.3.26

src/engines/ruby/2.7/Dockerfile.gnu

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,14 @@ ENV LANGUAGE en_US:en
4545
# Ensure consistent timezone
4646
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime
4747

48-
# Install things at a specific path and create ".bundle" in there as well:
49-
# This prevents pollution of an app volume and makes the bundle path mountable
50-
# as a volume as well.
48+
# don't create ".bundle" in all our apps
5149
ENV GEM_HOME /usr/local/bundle
52-
ENV BUNDLE_BIN="$GEM_HOME/bin" \
53-
BUNDLE_SILENCE_ROOT_WARNING=1 \
50+
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \
5451
BUNDLE_APP_CONFIG="$GEM_HOME"
55-
ENV PATH $BUNDLE_BIN:$PATH
56-
RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
57-
&& chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
52+
ENV PATH $GEM_HOME/bin:$PATH
53+
54+
# adjust permissions of a few directories for running "gem install" as an arbitrary user
55+
RUN mkdir -p "$GEM_HOME" && chmod 1777 "$GEM_HOME"
5856

5957
## Install a pinned RubyGems and Bundler
6058
RUN gem update --system 3.3.26

0 commit comments

Comments
 (0)