Skip to content

Commit dff4e42

Browse files
committed
Fix non-root support
Sorry, I messed this up in what should've been kind of an obvious way, and now it's much more robust and should actually work properly. 👍 See docker-library/ruby#69 for more context.
1 parent e1b06c1 commit dff4e42

File tree

4 files changed

+36
-40
lines changed

4 files changed

+36
-40
lines changed

1.7/jdk/Dockerfile

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,17 @@ RUN mkdir -p /opt/jruby/etc \
1919
echo 'update: --no-document'; \
2020
} >> /opt/jruby/etc/gemrc
2121

22-
RUN gem install bundler \
23-
&& bundle config --global path "$GEM_HOME" \
24-
&& bundle config --global bin "$GEM_HOME/bin" \
25-
&& bundle config --global silence_root_warning true
22+
RUN gem install bundler
2623

2724
# install things globally, for great justice
25+
# and don't create ".bundle" in all our apps
2826
ENV GEM_HOME /usr/local/bundle
29-
ENV PATH $GEM_HOME/bin:$PATH
30-
RUN mkdir -p "$GEM_HOME" \
31-
&& chmod 777 "$GEM_HOME"
32-
33-
# don't create ".bundle" in all our apps
34-
ENV BUNDLE_APP_CONFIG $GEM_HOME
27+
ENV BUNDLE_PATH="$GEM_HOME" \
28+
BUNDLE_BIN="$GEM_HOME/bin" \
29+
BUNDLE_SILENCE_ROOT_WARNING=1 \
30+
BUNDLE_APP_CONFIG="$GEM_HOME"
31+
ENV PATH $BUNDLE_BIN:$PATH
32+
RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
33+
&& chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
3534

3635
CMD [ "irb" ]

1.7/jre/Dockerfile

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,17 @@ RUN mkdir -p /opt/jruby/etc \
1919
echo 'update: --no-document'; \
2020
} >> /opt/jruby/etc/gemrc
2121

22-
RUN gem install bundler \
23-
&& bundle config --global path "$GEM_HOME" \
24-
&& bundle config --global bin "$GEM_HOME/bin" \
25-
&& bundle config --global silence_root_warning true
22+
RUN gem install bundler
2623

2724
# install things globally, for great justice
25+
# and don't create ".bundle" in all our apps
2826
ENV GEM_HOME /usr/local/bundle
29-
ENV PATH $GEM_HOME/bin:$PATH
30-
RUN mkdir -p "$GEM_HOME" \
31-
&& chmod 777 "$GEM_HOME"
32-
33-
# don't create ".bundle" in all our apps
34-
ENV BUNDLE_APP_CONFIG $GEM_HOME
27+
ENV BUNDLE_PATH="$GEM_HOME" \
28+
BUNDLE_BIN="$GEM_HOME/bin" \
29+
BUNDLE_SILENCE_ROOT_WARNING=1 \
30+
BUNDLE_APP_CONFIG="$GEM_HOME"
31+
ENV PATH $BUNDLE_BIN:$PATH
32+
RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
33+
&& chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
3534

3635
CMD [ "irb" ]

9000/jdk/Dockerfile

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,17 @@ RUN mkdir -p /opt/jruby/etc \
1919
echo 'update: --no-document'; \
2020
} >> /opt/jruby/etc/gemrc
2121

22-
RUN gem install bundler \
23-
&& bundle config --global path "$GEM_HOME" \
24-
&& bundle config --global bin "$GEM_HOME/bin" \
25-
&& bundle config --global silence_root_warning true
22+
RUN gem install bundler
2623

2724
# install things globally, for great justice
25+
# and don't create ".bundle" in all our apps
2826
ENV GEM_HOME /usr/local/bundle
29-
ENV PATH $GEM_HOME/bin:$PATH
30-
RUN mkdir -p "$GEM_HOME" \
31-
&& chmod 777 "$GEM_HOME"
32-
33-
# don't create ".bundle" in all our apps
34-
ENV BUNDLE_APP_CONFIG $GEM_HOME
27+
ENV BUNDLE_PATH="$GEM_HOME" \
28+
BUNDLE_BIN="$GEM_HOME/bin" \
29+
BUNDLE_SILENCE_ROOT_WARNING=1 \
30+
BUNDLE_APP_CONFIG="$GEM_HOME"
31+
ENV PATH $BUNDLE_BIN:$PATH
32+
RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
33+
&& chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
3534

3635
CMD [ "irb" ]

9000/jre/Dockerfile

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,17 @@ RUN mkdir -p /opt/jruby/etc \
1919
echo 'update: --no-document'; \
2020
} >> /opt/jruby/etc/gemrc
2121

22-
RUN gem install bundler \
23-
&& bundle config --global path "$GEM_HOME" \
24-
&& bundle config --global bin "$GEM_HOME/bin" \
25-
&& bundle config --global silence_root_warning true
22+
RUN gem install bundler
2623

2724
# install things globally, for great justice
25+
# and don't create ".bundle" in all our apps
2826
ENV GEM_HOME /usr/local/bundle
29-
ENV PATH $GEM_HOME/bin:$PATH
30-
RUN mkdir -p "$GEM_HOME" \
31-
&& chmod 777 "$GEM_HOME"
32-
33-
# don't create ".bundle" in all our apps
34-
ENV BUNDLE_APP_CONFIG $GEM_HOME
27+
ENV BUNDLE_PATH="$GEM_HOME" \
28+
BUNDLE_BIN="$GEM_HOME/bin" \
29+
BUNDLE_SILENCE_ROOT_WARNING=1 \
30+
BUNDLE_APP_CONFIG="$GEM_HOME"
31+
ENV PATH $BUNDLE_BIN:$PATH
32+
RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
33+
&& chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
3534

3635
CMD [ "irb" ]

0 commit comments

Comments
 (0)