From 47eacf19bea4a4cd4c887d76929b0667cd222723 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Wed, 3 Feb 2016 13:02:20 -0800 Subject: [PATCH] Apply templates --- 2.0/Dockerfile | 35 ++++++++++++++++++++++++----------- 2.0/slim/Dockerfile | 31 +++++++++++++++++++------------ 2.1/Dockerfile | 35 ++++++++++++++++++++++++----------- 2.1/alpine/Dockerfile | 33 ++++++++++++++++++++++----------- 2.1/slim/Dockerfile | 31 +++++++++++++++++++------------ 2.2/Dockerfile | 35 ++++++++++++++++++++++++----------- 2.2/alpine/Dockerfile | 33 ++++++++++++++++++++++----------- 2.2/slim/Dockerfile | 31 +++++++++++++++++++------------ 2.3/Dockerfile | 35 ++++++++++++++++++++++++----------- 2.3/alpine/Dockerfile | 33 ++++++++++++++++++++++----------- 2.3/slim/Dockerfile | 31 +++++++++++++++++++------------ 11 files changed, 238 insertions(+), 125 deletions(-) diff --git a/2.0/Dockerfile b/2.0/Dockerfile index 1a1efc1b97..91a80ab516 100644 --- a/2.0/Dockerfile +++ b/2.0/Dockerfile @@ -1,36 +1,43 @@ FROM buildpack-deps:jessie +# skip installing gem documentation +RUN mkdir -p /usr/local/etc \ + && { \ + echo 'install: --no-document'; \ + echo 'update: --no-document'; \ + } >> /usr/local/etc/gemrc + ENV RUBY_MAJOR 2.0 ENV RUBY_VERSION 2.0.0-p648 ENV RUBY_DOWNLOAD_SHA256 8690bd6b4949c333b3919755c4e48885dbfed6fd055fe9ef89930bde0d2376f8 ENV RUBYGEMS_VERSION 2.5.2 -# skip installing gem documentation -RUN echo 'install: --no-document\nupdate: --no-document' >> "$HOME/.gemrc" - # some of ruby's build scripts are written in ruby # we purge this later to make sure our final image uses what we just built -RUN apt-get update \ - && apt-get install -y bison libgdbm-dev ruby \ +RUN set -ex \ + && buildDeps=' \ + bison \ + libgdbm-dev \ + ruby \ + ' \ + && apt-get update \ + && apt-get install -y --no-install-recommends $buildDeps \ && rm -rf /var/lib/apt/lists/* \ - && mkdir -p /usr/src/ruby \ && curl -fSL -o ruby.tar.gz "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \ && echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \ + && mkdir -p /usr/src/ruby \ && tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \ && rm ruby.tar.gz \ && cd /usr/src/ruby \ + && { echo '#define ENABLE_PATH_CHECK 0'; echo; cat file.c; } > file.c.new && mv file.c.new file.c \ && autoconf \ && ./configure --disable-install-doc \ && make -j"$(nproc)" \ && make install \ - && apt-get purge -y --auto-remove bison libgdbm-dev ruby \ + && apt-get purge -y --auto-remove $buildDeps \ && gem update --system $RUBYGEMS_VERSION \ && rm -r /usr/src/ruby -# install things globally, for great justice -ENV GEM_HOME /usr/local/bundle -ENV PATH $GEM_HOME/bin:$PATH - ENV BUNDLER_VERSION 1.11.2 RUN gem install bundler --version "$BUNDLER_VERSION" \ @@ -38,6 +45,12 @@ RUN gem install bundler --version "$BUNDLER_VERSION" \ && bundle config --global bin "$GEM_HOME/bin" \ && bundle config --global silence_root_warning true +# install things globally, for great justice +ENV GEM_HOME /usr/local/bundle +ENV PATH $GEM_HOME/bin:$PATH +RUN mkdir -p "$GEM_HOME" \ + && chmod 777 "$GEM_HOME" + # don't create ".bundle" in all our apps ENV BUNDLE_APP_CONFIG $GEM_HOME diff --git a/2.0/slim/Dockerfile b/2.0/slim/Dockerfile index f3ceab243f..3a43c02b5b 100644 --- a/2.0/slim/Dockerfile +++ b/2.0/slim/Dockerfile @@ -13,17 +13,22 @@ RUN apt-get update \ zlib1g-dev \ && rm -rf /var/lib/apt/lists/* +# skip installing gem documentation +RUN mkdir -p /usr/local/etc \ + && { \ + echo 'install: --no-document'; \ + echo 'update: --no-document'; \ + } >> /usr/local/etc/gemrc + ENV RUBY_MAJOR 2.0 ENV RUBY_VERSION 2.0.0-p648 ENV RUBY_DOWNLOAD_SHA256 8690bd6b4949c333b3919755c4e48885dbfed6fd055fe9ef89930bde0d2376f8 ENV RUBYGEMS_VERSION 2.5.2 -# skip installing gem documentation -RUN echo 'install: --no-document\nupdate: --no-document' >> "$HOME/.gemrc" - # some of ruby's build scripts are written in ruby # we purge this later to make sure our final image uses what we just built -RUN buildDeps=' \ +RUN set -ex \ + && buildDeps=' \ autoconf \ bison \ gcc \ @@ -37,27 +42,23 @@ RUN buildDeps=' \ make \ ruby \ ' \ - && set -x \ && apt-get update \ && apt-get install -y --no-install-recommends $buildDeps \ && rm -rf /var/lib/apt/lists/* \ - && mkdir -p /usr/src/ruby \ && curl -fSL -o ruby.tar.gz "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \ && echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \ + && mkdir -p /usr/src/ruby \ && tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \ && rm ruby.tar.gz \ && cd /usr/src/ruby \ + && { echo '#define ENABLE_PATH_CHECK 0'; echo; cat file.c; } > file.c.new && mv file.c.new file.c \ && autoconf \ && ./configure --disable-install-doc \ && make -j"$(nproc)" \ && make install \ + && apt-get purge -y --auto-remove $buildDeps \ && gem update --system $RUBYGEMS_VERSION \ - && rm -r /usr/src/ruby \ - && apt-get purge -y --auto-remove $buildDeps - -# install things globally, for great justice -ENV GEM_HOME /usr/local/bundle -ENV PATH $GEM_HOME/bin:$PATH + && rm -r /usr/src/ruby ENV BUNDLER_VERSION 1.11.2 @@ -66,6 +67,12 @@ RUN gem install bundler --version "$BUNDLER_VERSION" \ && bundle config --global bin "$GEM_HOME/bin" \ && bundle config --global silence_root_warning true +# install things globally, for great justice +ENV GEM_HOME /usr/local/bundle +ENV PATH $GEM_HOME/bin:$PATH +RUN mkdir -p "$GEM_HOME" \ + && chmod 777 "$GEM_HOME" + # don't create ".bundle" in all our apps ENV BUNDLE_APP_CONFIG $GEM_HOME diff --git a/2.1/Dockerfile b/2.1/Dockerfile index aa30225a52..68b9c2f13a 100644 --- a/2.1/Dockerfile +++ b/2.1/Dockerfile @@ -1,36 +1,43 @@ FROM buildpack-deps:jessie +# skip installing gem documentation +RUN mkdir -p /usr/local/etc \ + && { \ + echo 'install: --no-document'; \ + echo 'update: --no-document'; \ + } >> /usr/local/etc/gemrc + ENV RUBY_MAJOR 2.1 ENV RUBY_VERSION 2.1.8 ENV RUBY_DOWNLOAD_SHA256 afd832b8d5ecb2e3e1477ec6a9408fdf9898ee73e4c5df17a2b2cb36bd1c355d ENV RUBYGEMS_VERSION 2.5.2 -# skip installing gem documentation -RUN echo 'install: --no-document\nupdate: --no-document' >> "$HOME/.gemrc" - # some of ruby's build scripts are written in ruby # we purge this later to make sure our final image uses what we just built -RUN apt-get update \ - && apt-get install -y bison libgdbm-dev ruby \ +RUN set -ex \ + && buildDeps=' \ + bison \ + libgdbm-dev \ + ruby \ + ' \ + && apt-get update \ + && apt-get install -y --no-install-recommends $buildDeps \ && rm -rf /var/lib/apt/lists/* \ - && mkdir -p /usr/src/ruby \ && curl -fSL -o ruby.tar.gz "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \ && echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \ + && mkdir -p /usr/src/ruby \ && tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \ && rm ruby.tar.gz \ && cd /usr/src/ruby \ + && { echo '#define ENABLE_PATH_CHECK 0'; echo; cat file.c; } > file.c.new && mv file.c.new file.c \ && autoconf \ && ./configure --disable-install-doc \ && make -j"$(nproc)" \ && make install \ - && apt-get purge -y --auto-remove bison libgdbm-dev ruby \ + && apt-get purge -y --auto-remove $buildDeps \ && gem update --system $RUBYGEMS_VERSION \ && rm -r /usr/src/ruby -# install things globally, for great justice -ENV GEM_HOME /usr/local/bundle -ENV PATH $GEM_HOME/bin:$PATH - ENV BUNDLER_VERSION 1.11.2 RUN gem install bundler --version "$BUNDLER_VERSION" \ @@ -38,6 +45,12 @@ RUN gem install bundler --version "$BUNDLER_VERSION" \ && bundle config --global bin "$GEM_HOME/bin" \ && bundle config --global silence_root_warning true +# install things globally, for great justice +ENV GEM_HOME /usr/local/bundle +ENV PATH $GEM_HOME/bin:$PATH +RUN mkdir -p "$GEM_HOME" \ + && chmod 777 "$GEM_HOME" + # don't create ".bundle" in all our apps ENV BUNDLE_APP_CONFIG $GEM_HOME diff --git a/2.1/alpine/Dockerfile b/2.1/alpine/Dockerfile index b97f028895..dc5bb69b56 100644 --- a/2.1/alpine/Dockerfile +++ b/2.1/alpine/Dockerfile @@ -1,14 +1,20 @@ FROM alpine:3.3 +# skip installing gem documentation +RUN mkdir -p /usr/local/etc \ + && { \ + echo 'install: --no-document'; \ + echo 'update: --no-document'; \ + } >> /usr/local/etc/gemrc + ENV RUBY_MAJOR 2.1 ENV RUBY_VERSION 2.1.8 ENV RUBY_DOWNLOAD_SHA256 afd832b8d5ecb2e3e1477ec6a9408fdf9898ee73e4c5df17a2b2cb36bd1c355d ENV RUBYGEMS_VERSION 2.5.2 -# skip installing gem documentation -RUN echo -e 'install: --no-document\nupdate: --no-document' >> "$HOME/.gemrc" - -RUN set -x \ +# some of ruby's build scripts are written in ruby +# we purge this later to make sure our final image uses what we just built +RUN set -ex \ && apk add --no-cache --virtual .ruby-builddeps \ autoconf \ bison \ @@ -40,12 +46,13 @@ RUN set -x \ && mv "/usr/src/ruby-$RUBY_VERSION" /usr/src/ruby \ && rm ruby.tar.gz \ && cd /usr/src/ruby \ + && { echo '#define ENABLE_PATH_CHECK 0'; echo; cat file.c; } > file.c.new && mv file.c.new file.c \ && autoconf \ # the configure script does not detect isnan/isinf as macros - && ac_cv_func_isnan=yes ac_cv_func_isinf=yes ./configure --disable-install-doc \ + && ac_cv_func_isnan=yes ac_cv_func_isinf=yes \ + ./configure --disable-install-doc \ && make -j"$(nproc)" \ && make install \ - && gem update --system $RUBYGEMS_VERSION \ && runDeps="$( \ scanelf --needed --nobanner --recursive /usr/local \ | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ @@ -63,17 +70,21 @@ RUN set -x \ procps \ zlib-dev \ && apk del .ruby-builddeps \ + && gem update --system $RUBYGEMS_VERSION \ && rm -r /usr/src/ruby -# install things globally, for great justice -ENV GEM_HOME /usr/local/bundle -ENV PATH $GEM_HOME/bin:$PATH - ENV BUNDLER_VERSION 1.11.2 RUN gem install bundler --version "$BUNDLER_VERSION" \ && bundle config --global path "$GEM_HOME" \ - && bundle config --global bin "$GEM_HOME/bin" + && bundle config --global bin "$GEM_HOME/bin" \ + && bundle config --global silence_root_warning true + +# install things globally, for great justice +ENV GEM_HOME /usr/local/bundle +ENV PATH $GEM_HOME/bin:$PATH +RUN mkdir -p "$GEM_HOME" \ + && chmod 777 "$GEM_HOME" # don't create ".bundle" in all our apps ENV BUNDLE_APP_CONFIG $GEM_HOME diff --git a/2.1/slim/Dockerfile b/2.1/slim/Dockerfile index c3633cd2d1..72992e12b9 100644 --- a/2.1/slim/Dockerfile +++ b/2.1/slim/Dockerfile @@ -13,17 +13,22 @@ RUN apt-get update \ zlib1g-dev \ && rm -rf /var/lib/apt/lists/* +# skip installing gem documentation +RUN mkdir -p /usr/local/etc \ + && { \ + echo 'install: --no-document'; \ + echo 'update: --no-document'; \ + } >> /usr/local/etc/gemrc + ENV RUBY_MAJOR 2.1 ENV RUBY_VERSION 2.1.8 ENV RUBY_DOWNLOAD_SHA256 afd832b8d5ecb2e3e1477ec6a9408fdf9898ee73e4c5df17a2b2cb36bd1c355d ENV RUBYGEMS_VERSION 2.5.2 -# skip installing gem documentation -RUN echo 'install: --no-document\nupdate: --no-document' >> "$HOME/.gemrc" - # some of ruby's build scripts are written in ruby # we purge this later to make sure our final image uses what we just built -RUN buildDeps=' \ +RUN set -ex \ + && buildDeps=' \ autoconf \ bison \ gcc \ @@ -37,27 +42,23 @@ RUN buildDeps=' \ make \ ruby \ ' \ - && set -x \ && apt-get update \ && apt-get install -y --no-install-recommends $buildDeps \ && rm -rf /var/lib/apt/lists/* \ - && mkdir -p /usr/src/ruby \ && curl -fSL -o ruby.tar.gz "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \ && echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \ + && mkdir -p /usr/src/ruby \ && tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \ && rm ruby.tar.gz \ && cd /usr/src/ruby \ + && { echo '#define ENABLE_PATH_CHECK 0'; echo; cat file.c; } > file.c.new && mv file.c.new file.c \ && autoconf \ && ./configure --disable-install-doc \ && make -j"$(nproc)" \ && make install \ + && apt-get purge -y --auto-remove $buildDeps \ && gem update --system $RUBYGEMS_VERSION \ - && rm -r /usr/src/ruby \ - && apt-get purge -y --auto-remove $buildDeps - -# install things globally, for great justice -ENV GEM_HOME /usr/local/bundle -ENV PATH $GEM_HOME/bin:$PATH + && rm -r /usr/src/ruby ENV BUNDLER_VERSION 1.11.2 @@ -66,6 +67,12 @@ RUN gem install bundler --version "$BUNDLER_VERSION" \ && bundle config --global bin "$GEM_HOME/bin" \ && bundle config --global silence_root_warning true +# install things globally, for great justice +ENV GEM_HOME /usr/local/bundle +ENV PATH $GEM_HOME/bin:$PATH +RUN mkdir -p "$GEM_HOME" \ + && chmod 777 "$GEM_HOME" + # don't create ".bundle" in all our apps ENV BUNDLE_APP_CONFIG $GEM_HOME diff --git a/2.2/Dockerfile b/2.2/Dockerfile index 977d480d29..541c8cff5e 100644 --- a/2.2/Dockerfile +++ b/2.2/Dockerfile @@ -1,36 +1,43 @@ FROM buildpack-deps:jessie +# skip installing gem documentation +RUN mkdir -p /usr/local/etc \ + && { \ + echo 'install: --no-document'; \ + echo 'update: --no-document'; \ + } >> /usr/local/etc/gemrc + ENV RUBY_MAJOR 2.2 ENV RUBY_VERSION 2.2.4 ENV RUBY_DOWNLOAD_SHA256 b6eff568b48e0fda76e5a36333175df049b204e91217aa32a65153cc0cdcb761 ENV RUBYGEMS_VERSION 2.5.2 -# skip installing gem documentation -RUN echo 'install: --no-document\nupdate: --no-document' >> "$HOME/.gemrc" - # some of ruby's build scripts are written in ruby # we purge this later to make sure our final image uses what we just built -RUN apt-get update \ - && apt-get install -y bison libgdbm-dev ruby \ +RUN set -ex \ + && buildDeps=' \ + bison \ + libgdbm-dev \ + ruby \ + ' \ + && apt-get update \ + && apt-get install -y --no-install-recommends $buildDeps \ && rm -rf /var/lib/apt/lists/* \ - && mkdir -p /usr/src/ruby \ && curl -fSL -o ruby.tar.gz "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \ && echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \ + && mkdir -p /usr/src/ruby \ && tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \ && rm ruby.tar.gz \ && cd /usr/src/ruby \ + && { echo '#define ENABLE_PATH_CHECK 0'; echo; cat file.c; } > file.c.new && mv file.c.new file.c \ && autoconf \ && ./configure --disable-install-doc \ && make -j"$(nproc)" \ && make install \ - && apt-get purge -y --auto-remove bison libgdbm-dev ruby \ + && apt-get purge -y --auto-remove $buildDeps \ && gem update --system $RUBYGEMS_VERSION \ && rm -r /usr/src/ruby -# install things globally, for great justice -ENV GEM_HOME /usr/local/bundle -ENV PATH $GEM_HOME/bin:$PATH - ENV BUNDLER_VERSION 1.11.2 RUN gem install bundler --version "$BUNDLER_VERSION" \ @@ -38,6 +45,12 @@ RUN gem install bundler --version "$BUNDLER_VERSION" \ && bundle config --global bin "$GEM_HOME/bin" \ && bundle config --global silence_root_warning true +# install things globally, for great justice +ENV GEM_HOME /usr/local/bundle +ENV PATH $GEM_HOME/bin:$PATH +RUN mkdir -p "$GEM_HOME" \ + && chmod 777 "$GEM_HOME" + # don't create ".bundle" in all our apps ENV BUNDLE_APP_CONFIG $GEM_HOME diff --git a/2.2/alpine/Dockerfile b/2.2/alpine/Dockerfile index fb3d14f4b3..f228c6efc4 100644 --- a/2.2/alpine/Dockerfile +++ b/2.2/alpine/Dockerfile @@ -1,14 +1,20 @@ FROM alpine:3.3 +# skip installing gem documentation +RUN mkdir -p /usr/local/etc \ + && { \ + echo 'install: --no-document'; \ + echo 'update: --no-document'; \ + } >> /usr/local/etc/gemrc + ENV RUBY_MAJOR 2.2 ENV RUBY_VERSION 2.2.4 ENV RUBY_DOWNLOAD_SHA256 b6eff568b48e0fda76e5a36333175df049b204e91217aa32a65153cc0cdcb761 ENV RUBYGEMS_VERSION 2.5.2 -# skip installing gem documentation -RUN echo -e 'install: --no-document\nupdate: --no-document' >> "$HOME/.gemrc" - -RUN set -x \ +# some of ruby's build scripts are written in ruby +# we purge this later to make sure our final image uses what we just built +RUN set -ex \ && apk add --no-cache --virtual .ruby-builddeps \ autoconf \ bison \ @@ -40,12 +46,13 @@ RUN set -x \ && mv "/usr/src/ruby-$RUBY_VERSION" /usr/src/ruby \ && rm ruby.tar.gz \ && cd /usr/src/ruby \ + && { echo '#define ENABLE_PATH_CHECK 0'; echo; cat file.c; } > file.c.new && mv file.c.new file.c \ && autoconf \ # the configure script does not detect isnan/isinf as macros - && ac_cv_func_isnan=yes ac_cv_func_isinf=yes ./configure --disable-install-doc \ + && ac_cv_func_isnan=yes ac_cv_func_isinf=yes \ + ./configure --disable-install-doc \ && make -j"$(nproc)" \ && make install \ - && gem update --system $RUBYGEMS_VERSION \ && runDeps="$( \ scanelf --needed --nobanner --recursive /usr/local \ | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ @@ -63,17 +70,21 @@ RUN set -x \ procps \ zlib-dev \ && apk del .ruby-builddeps \ + && gem update --system $RUBYGEMS_VERSION \ && rm -r /usr/src/ruby -# install things globally, for great justice -ENV GEM_HOME /usr/local/bundle -ENV PATH $GEM_HOME/bin:$PATH - ENV BUNDLER_VERSION 1.11.2 RUN gem install bundler --version "$BUNDLER_VERSION" \ && bundle config --global path "$GEM_HOME" \ - && bundle config --global bin "$GEM_HOME/bin" + && bundle config --global bin "$GEM_HOME/bin" \ + && bundle config --global silence_root_warning true + +# install things globally, for great justice +ENV GEM_HOME /usr/local/bundle +ENV PATH $GEM_HOME/bin:$PATH +RUN mkdir -p "$GEM_HOME" \ + && chmod 777 "$GEM_HOME" # don't create ".bundle" in all our apps ENV BUNDLE_APP_CONFIG $GEM_HOME diff --git a/2.2/slim/Dockerfile b/2.2/slim/Dockerfile index 24d9a977fb..a798ca183e 100644 --- a/2.2/slim/Dockerfile +++ b/2.2/slim/Dockerfile @@ -13,17 +13,22 @@ RUN apt-get update \ zlib1g-dev \ && rm -rf /var/lib/apt/lists/* +# skip installing gem documentation +RUN mkdir -p /usr/local/etc \ + && { \ + echo 'install: --no-document'; \ + echo 'update: --no-document'; \ + } >> /usr/local/etc/gemrc + ENV RUBY_MAJOR 2.2 ENV RUBY_VERSION 2.2.4 ENV RUBY_DOWNLOAD_SHA256 b6eff568b48e0fda76e5a36333175df049b204e91217aa32a65153cc0cdcb761 ENV RUBYGEMS_VERSION 2.5.2 -# skip installing gem documentation -RUN echo 'install: --no-document\nupdate: --no-document' >> "$HOME/.gemrc" - # some of ruby's build scripts are written in ruby # we purge this later to make sure our final image uses what we just built -RUN buildDeps=' \ +RUN set -ex \ + && buildDeps=' \ autoconf \ bison \ gcc \ @@ -37,27 +42,23 @@ RUN buildDeps=' \ make \ ruby \ ' \ - && set -x \ && apt-get update \ && apt-get install -y --no-install-recommends $buildDeps \ && rm -rf /var/lib/apt/lists/* \ - && mkdir -p /usr/src/ruby \ && curl -fSL -o ruby.tar.gz "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \ && echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \ + && mkdir -p /usr/src/ruby \ && tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \ && rm ruby.tar.gz \ && cd /usr/src/ruby \ + && { echo '#define ENABLE_PATH_CHECK 0'; echo; cat file.c; } > file.c.new && mv file.c.new file.c \ && autoconf \ && ./configure --disable-install-doc \ && make -j"$(nproc)" \ && make install \ + && apt-get purge -y --auto-remove $buildDeps \ && gem update --system $RUBYGEMS_VERSION \ - && rm -r /usr/src/ruby \ - && apt-get purge -y --auto-remove $buildDeps - -# install things globally, for great justice -ENV GEM_HOME /usr/local/bundle -ENV PATH $GEM_HOME/bin:$PATH + && rm -r /usr/src/ruby ENV BUNDLER_VERSION 1.11.2 @@ -66,6 +67,12 @@ RUN gem install bundler --version "$BUNDLER_VERSION" \ && bundle config --global bin "$GEM_HOME/bin" \ && bundle config --global silence_root_warning true +# install things globally, for great justice +ENV GEM_HOME /usr/local/bundle +ENV PATH $GEM_HOME/bin:$PATH +RUN mkdir -p "$GEM_HOME" \ + && chmod 777 "$GEM_HOME" + # don't create ".bundle" in all our apps ENV BUNDLE_APP_CONFIG $GEM_HOME diff --git a/2.3/Dockerfile b/2.3/Dockerfile index 8ef3eae40f..a0565f00f4 100644 --- a/2.3/Dockerfile +++ b/2.3/Dockerfile @@ -1,36 +1,43 @@ FROM buildpack-deps:jessie +# skip installing gem documentation +RUN mkdir -p /usr/local/etc \ + && { \ + echo 'install: --no-document'; \ + echo 'update: --no-document'; \ + } >> /usr/local/etc/gemrc + ENV RUBY_MAJOR 2.3 ENV RUBY_VERSION 2.3.0 ENV RUBY_DOWNLOAD_SHA256 ba5ba60e5f1aa21b4ef8e9bf35b9ddb57286cb546aac4b5a28c71f459467e507 ENV RUBYGEMS_VERSION 2.5.2 -# skip installing gem documentation -RUN echo 'install: --no-document\nupdate: --no-document' >> "$HOME/.gemrc" - # some of ruby's build scripts are written in ruby # we purge this later to make sure our final image uses what we just built -RUN apt-get update \ - && apt-get install -y bison libgdbm-dev ruby \ +RUN set -ex \ + && buildDeps=' \ + bison \ + libgdbm-dev \ + ruby \ + ' \ + && apt-get update \ + && apt-get install -y --no-install-recommends $buildDeps \ && rm -rf /var/lib/apt/lists/* \ - && mkdir -p /usr/src/ruby \ && curl -fSL -o ruby.tar.gz "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \ && echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \ + && mkdir -p /usr/src/ruby \ && tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \ && rm ruby.tar.gz \ && cd /usr/src/ruby \ + && { echo '#define ENABLE_PATH_CHECK 0'; echo; cat file.c; } > file.c.new && mv file.c.new file.c \ && autoconf \ && ./configure --disable-install-doc \ && make -j"$(nproc)" \ && make install \ - && apt-get purge -y --auto-remove bison libgdbm-dev ruby \ + && apt-get purge -y --auto-remove $buildDeps \ && gem update --system $RUBYGEMS_VERSION \ && rm -r /usr/src/ruby -# install things globally, for great justice -ENV GEM_HOME /usr/local/bundle -ENV PATH $GEM_HOME/bin:$PATH - ENV BUNDLER_VERSION 1.11.2 RUN gem install bundler --version "$BUNDLER_VERSION" \ @@ -38,6 +45,12 @@ RUN gem install bundler --version "$BUNDLER_VERSION" \ && bundle config --global bin "$GEM_HOME/bin" \ && bundle config --global silence_root_warning true +# install things globally, for great justice +ENV GEM_HOME /usr/local/bundle +ENV PATH $GEM_HOME/bin:$PATH +RUN mkdir -p "$GEM_HOME" \ + && chmod 777 "$GEM_HOME" + # don't create ".bundle" in all our apps ENV BUNDLE_APP_CONFIG $GEM_HOME diff --git a/2.3/alpine/Dockerfile b/2.3/alpine/Dockerfile index 544686da8c..7a562e8737 100644 --- a/2.3/alpine/Dockerfile +++ b/2.3/alpine/Dockerfile @@ -1,14 +1,20 @@ FROM alpine:3.3 +# skip installing gem documentation +RUN mkdir -p /usr/local/etc \ + && { \ + echo 'install: --no-document'; \ + echo 'update: --no-document'; \ + } >> /usr/local/etc/gemrc + ENV RUBY_MAJOR 2.3 ENV RUBY_VERSION 2.3.0 ENV RUBY_DOWNLOAD_SHA256 ba5ba60e5f1aa21b4ef8e9bf35b9ddb57286cb546aac4b5a28c71f459467e507 ENV RUBYGEMS_VERSION 2.5.2 -# skip installing gem documentation -RUN echo -e 'install: --no-document\nupdate: --no-document' >> "$HOME/.gemrc" - -RUN set -x \ +# some of ruby's build scripts are written in ruby +# we purge this later to make sure our final image uses what we just built +RUN set -ex \ && apk add --no-cache --virtual .ruby-builddeps \ autoconf \ bison \ @@ -40,12 +46,13 @@ RUN set -x \ && mv "/usr/src/ruby-$RUBY_VERSION" /usr/src/ruby \ && rm ruby.tar.gz \ && cd /usr/src/ruby \ + && { echo '#define ENABLE_PATH_CHECK 0'; echo; cat file.c; } > file.c.new && mv file.c.new file.c \ && autoconf \ # the configure script does not detect isnan/isinf as macros - && ac_cv_func_isnan=yes ac_cv_func_isinf=yes ./configure --disable-install-doc \ + && ac_cv_func_isnan=yes ac_cv_func_isinf=yes \ + ./configure --disable-install-doc \ && make -j"$(nproc)" \ && make install \ - && gem update --system $RUBYGEMS_VERSION \ && runDeps="$( \ scanelf --needed --nobanner --recursive /usr/local \ | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ @@ -63,17 +70,21 @@ RUN set -x \ procps \ zlib-dev \ && apk del .ruby-builddeps \ + && gem update --system $RUBYGEMS_VERSION \ && rm -r /usr/src/ruby -# install things globally, for great justice -ENV GEM_HOME /usr/local/bundle -ENV PATH $GEM_HOME/bin:$PATH - ENV BUNDLER_VERSION 1.11.2 RUN gem install bundler --version "$BUNDLER_VERSION" \ && bundle config --global path "$GEM_HOME" \ - && bundle config --global bin "$GEM_HOME/bin" + && bundle config --global bin "$GEM_HOME/bin" \ + && bundle config --global silence_root_warning true + +# install things globally, for great justice +ENV GEM_HOME /usr/local/bundle +ENV PATH $GEM_HOME/bin:$PATH +RUN mkdir -p "$GEM_HOME" \ + && chmod 777 "$GEM_HOME" # don't create ".bundle" in all our apps ENV BUNDLE_APP_CONFIG $GEM_HOME diff --git a/2.3/slim/Dockerfile b/2.3/slim/Dockerfile index efd31fe4a9..4dd5dbf848 100644 --- a/2.3/slim/Dockerfile +++ b/2.3/slim/Dockerfile @@ -13,17 +13,22 @@ RUN apt-get update \ zlib1g-dev \ && rm -rf /var/lib/apt/lists/* +# skip installing gem documentation +RUN mkdir -p /usr/local/etc \ + && { \ + echo 'install: --no-document'; \ + echo 'update: --no-document'; \ + } >> /usr/local/etc/gemrc + ENV RUBY_MAJOR 2.3 ENV RUBY_VERSION 2.3.0 ENV RUBY_DOWNLOAD_SHA256 ba5ba60e5f1aa21b4ef8e9bf35b9ddb57286cb546aac4b5a28c71f459467e507 ENV RUBYGEMS_VERSION 2.5.2 -# skip installing gem documentation -RUN echo 'install: --no-document\nupdate: --no-document' >> "$HOME/.gemrc" - # some of ruby's build scripts are written in ruby # we purge this later to make sure our final image uses what we just built -RUN buildDeps=' \ +RUN set -ex \ + && buildDeps=' \ autoconf \ bison \ gcc \ @@ -37,27 +42,23 @@ RUN buildDeps=' \ make \ ruby \ ' \ - && set -x \ && apt-get update \ && apt-get install -y --no-install-recommends $buildDeps \ && rm -rf /var/lib/apt/lists/* \ - && mkdir -p /usr/src/ruby \ && curl -fSL -o ruby.tar.gz "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \ && echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \ + && mkdir -p /usr/src/ruby \ && tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \ && rm ruby.tar.gz \ && cd /usr/src/ruby \ + && { echo '#define ENABLE_PATH_CHECK 0'; echo; cat file.c; } > file.c.new && mv file.c.new file.c \ && autoconf \ && ./configure --disable-install-doc \ && make -j"$(nproc)" \ && make install \ + && apt-get purge -y --auto-remove $buildDeps \ && gem update --system $RUBYGEMS_VERSION \ - && rm -r /usr/src/ruby \ - && apt-get purge -y --auto-remove $buildDeps - -# install things globally, for great justice -ENV GEM_HOME /usr/local/bundle -ENV PATH $GEM_HOME/bin:$PATH + && rm -r /usr/src/ruby ENV BUNDLER_VERSION 1.11.2 @@ -66,6 +67,12 @@ RUN gem install bundler --version "$BUNDLER_VERSION" \ && bundle config --global bin "$GEM_HOME/bin" \ && bundle config --global silence_root_warning true +# install things globally, for great justice +ENV GEM_HOME /usr/local/bundle +ENV PATH $GEM_HOME/bin:$PATH +RUN mkdir -p "$GEM_HOME" \ + && chmod 777 "$GEM_HOME" + # don't create ".bundle" in all our apps ENV BUNDLE_APP_CONFIG $GEM_HOME