@@ -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
9392ENV 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
101100CMD [ " irb" ]
102101
@@ -144,16 +143,14 @@ ENV LANGUAGE en_US:en
144143# Ensure consistent timezone
145144RUN 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
150147ENV 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
159156RUN gem update --system 2.7 .11
0 commit comments