Skip to content

Commit 2ff3570

Browse files
committed
Apply templates
1 parent 5e4e945 commit 2ff3570

File tree

11 files changed

+227
-125
lines changed

11 files changed

+227
-125
lines changed

2.0/Dockerfile

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,55 @@
11
FROM buildpack-deps:jessie
22

3+
# skip installing gem documentation
4+
RUN { \
5+
echo 'install: --no-document'; \
6+
echo 'update: --no-document'; \
7+
} >> /usr/local/etc/gemrc
8+
39
ENV RUBY_MAJOR 2.0
410
ENV RUBY_VERSION 2.0.0-p648
511
ENV RUBY_DOWNLOAD_SHA256 8690bd6b4949c333b3919755c4e48885dbfed6fd055fe9ef89930bde0d2376f8
612
ENV RUBYGEMS_VERSION 2.5.2
713

8-
# skip installing gem documentation
9-
RUN echo 'install: --no-document\nupdate: --no-document' >> "$HOME/.gemrc"
10-
1114
# some of ruby's build scripts are written in ruby
1215
# we purge this later to make sure our final image uses what we just built
13-
RUN apt-get update \
14-
&& apt-get install -y bison libgdbm-dev ruby \
16+
RUN set -ex \
17+
&& buildDeps=' \
18+
bison \
19+
libgdbm-dev \
20+
ruby \
21+
' \
22+
&& apt-get update \
23+
&& apt-get install -y --no-install-recommends $buildDeps \
1524
&& rm -rf /var/lib/apt/lists/* \
16-
&& mkdir -p /usr/src/ruby \
1725
&& curl -fSL -o ruby.tar.gz "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \
1826
&& echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \
27+
&& mkdir -p /usr/src/ruby \
1928
&& tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \
2029
&& rm ruby.tar.gz \
2130
&& cd /usr/src/ruby \
31+
&& { echo '#define ENABLE_PATH_CHECK 0'; echo; cat file.c; } > file.c.new && mv file.c.new file.c \
2232
&& autoconf \
2333
&& ./configure --disable-install-doc \
2434
&& make -j"$(nproc)" \
2535
&& make install \
26-
&& apt-get purge -y --auto-remove bison libgdbm-dev ruby \
36+
&& apt-get purge -y --auto-remove $buildDeps \
2737
&& gem update --system $RUBYGEMS_VERSION \
2838
&& rm -r /usr/src/ruby
2939

30-
# install things globally, for great justice
31-
ENV GEM_HOME /usr/local/bundle
32-
ENV PATH $GEM_HOME/bin:$PATH
33-
3440
ENV BUNDLER_VERSION 1.11.2
3541

3642
RUN gem install bundler --version "$BUNDLER_VERSION" \
3743
&& bundle config --global path "$GEM_HOME" \
3844
&& bundle config --global bin "$GEM_HOME/bin" \
3945
&& bundle config --global silence_root_warning true
4046

47+
# install things globally, for great justice
48+
ENV GEM_HOME /usr/local/bundle
49+
ENV PATH $GEM_HOME/bin:$PATH
50+
RUN mkdir -p "$GEM_HOME" \
51+
&& chmod 777 "$GEM_HOME"
52+
4153
# don't create ".bundle" in all our apps
4254
ENV BUNDLE_APP_CONFIG $GEM_HOME
4355

2.0/slim/Dockerfile

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,21 @@ RUN apt-get update \
1313
zlib1g-dev \
1414
&& rm -rf /var/lib/apt/lists/*
1515

16+
# skip installing gem documentation
17+
RUN { \
18+
echo 'install: --no-document'; \
19+
echo 'update: --no-document'; \
20+
} >> /usr/local/etc/gemrc
21+
1622
ENV RUBY_MAJOR 2.0
1723
ENV RUBY_VERSION 2.0.0-p648
1824
ENV RUBY_DOWNLOAD_SHA256 8690bd6b4949c333b3919755c4e48885dbfed6fd055fe9ef89930bde0d2376f8
1925
ENV RUBYGEMS_VERSION 2.5.2
2026

21-
# skip installing gem documentation
22-
RUN echo 'install: --no-document\nupdate: --no-document' >> "$HOME/.gemrc"
23-
2427
# some of ruby's build scripts are written in ruby
2528
# we purge this later to make sure our final image uses what we just built
26-
RUN buildDeps=' \
29+
RUN set -ex \
30+
&& buildDeps=' \
2731
autoconf \
2832
bison \
2933
gcc \
@@ -37,27 +41,23 @@ RUN buildDeps=' \
3741
make \
3842
ruby \
3943
' \
40-
&& set -x \
4144
&& apt-get update \
4245
&& apt-get install -y --no-install-recommends $buildDeps \
4346
&& rm -rf /var/lib/apt/lists/* \
44-
&& mkdir -p /usr/src/ruby \
4547
&& curl -fSL -o ruby.tar.gz "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \
4648
&& echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \
49+
&& mkdir -p /usr/src/ruby \
4750
&& tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \
4851
&& rm ruby.tar.gz \
4952
&& cd /usr/src/ruby \
53+
&& { echo '#define ENABLE_PATH_CHECK 0'; echo; cat file.c; } > file.c.new && mv file.c.new file.c \
5054
&& autoconf \
5155
&& ./configure --disable-install-doc \
5256
&& make -j"$(nproc)" \
5357
&& make install \
58+
&& apt-get purge -y --auto-remove $buildDeps \
5459
&& gem update --system $RUBYGEMS_VERSION \
55-
&& rm -r /usr/src/ruby \
56-
&& apt-get purge -y --auto-remove $buildDeps
57-
58-
# install things globally, for great justice
59-
ENV GEM_HOME /usr/local/bundle
60-
ENV PATH $GEM_HOME/bin:$PATH
60+
&& rm -r /usr/src/ruby
6161

6262
ENV BUNDLER_VERSION 1.11.2
6363

@@ -66,6 +66,12 @@ RUN gem install bundler --version "$BUNDLER_VERSION" \
6666
&& bundle config --global bin "$GEM_HOME/bin" \
6767
&& bundle config --global silence_root_warning true
6868

69+
# install things globally, for great justice
70+
ENV GEM_HOME /usr/local/bundle
71+
ENV PATH $GEM_HOME/bin:$PATH
72+
RUN mkdir -p "$GEM_HOME" \
73+
&& chmod 777 "$GEM_HOME"
74+
6975
# don't create ".bundle" in all our apps
7076
ENV BUNDLE_APP_CONFIG $GEM_HOME
7177

2.1/Dockerfile

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,55 @@
11
FROM buildpack-deps:jessie
22

3+
# skip installing gem documentation
4+
RUN { \
5+
echo 'install: --no-document'; \
6+
echo 'update: --no-document'; \
7+
} >> /usr/local/etc/gemrc
8+
39
ENV RUBY_MAJOR 2.1
410
ENV RUBY_VERSION 2.1.8
511
ENV RUBY_DOWNLOAD_SHA256 afd832b8d5ecb2e3e1477ec6a9408fdf9898ee73e4c5df17a2b2cb36bd1c355d
612
ENV RUBYGEMS_VERSION 2.5.2
713

8-
# skip installing gem documentation
9-
RUN echo 'install: --no-document\nupdate: --no-document' >> "$HOME/.gemrc"
10-
1114
# some of ruby's build scripts are written in ruby
1215
# we purge this later to make sure our final image uses what we just built
13-
RUN apt-get update \
14-
&& apt-get install -y bison libgdbm-dev ruby \
16+
RUN set -ex \
17+
&& buildDeps=' \
18+
bison \
19+
libgdbm-dev \
20+
ruby \
21+
' \
22+
&& apt-get update \
23+
&& apt-get install -y --no-install-recommends $buildDeps \
1524
&& rm -rf /var/lib/apt/lists/* \
16-
&& mkdir -p /usr/src/ruby \
1725
&& curl -fSL -o ruby.tar.gz "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \
1826
&& echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \
27+
&& mkdir -p /usr/src/ruby \
1928
&& tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \
2029
&& rm ruby.tar.gz \
2130
&& cd /usr/src/ruby \
31+
&& { echo '#define ENABLE_PATH_CHECK 0'; echo; cat file.c; } > file.c.new && mv file.c.new file.c \
2232
&& autoconf \
2333
&& ./configure --disable-install-doc \
2434
&& make -j"$(nproc)" \
2535
&& make install \
26-
&& apt-get purge -y --auto-remove bison libgdbm-dev ruby \
36+
&& apt-get purge -y --auto-remove $buildDeps \
2737
&& gem update --system $RUBYGEMS_VERSION \
2838
&& rm -r /usr/src/ruby
2939

30-
# install things globally, for great justice
31-
ENV GEM_HOME /usr/local/bundle
32-
ENV PATH $GEM_HOME/bin:$PATH
33-
3440
ENV BUNDLER_VERSION 1.11.2
3541

3642
RUN gem install bundler --version "$BUNDLER_VERSION" \
3743
&& bundle config --global path "$GEM_HOME" \
3844
&& bundle config --global bin "$GEM_HOME/bin" \
3945
&& bundle config --global silence_root_warning true
4046

47+
# install things globally, for great justice
48+
ENV GEM_HOME /usr/local/bundle
49+
ENV PATH $GEM_HOME/bin:$PATH
50+
RUN mkdir -p "$GEM_HOME" \
51+
&& chmod 777 "$GEM_HOME"
52+
4153
# don't create ".bundle" in all our apps
4254
ENV BUNDLE_APP_CONFIG $GEM_HOME
4355

2.1/alpine/Dockerfile

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
FROM alpine:3.3
22

3+
# skip installing gem documentation
4+
RUN { \
5+
echo 'install: --no-document'; \
6+
echo 'update: --no-document'; \
7+
} >> /usr/local/etc/gemrc
8+
39
ENV RUBY_MAJOR 2.1
410
ENV RUBY_VERSION 2.1.8
511
ENV RUBY_DOWNLOAD_SHA256 afd832b8d5ecb2e3e1477ec6a9408fdf9898ee73e4c5df17a2b2cb36bd1c355d
612
ENV RUBYGEMS_VERSION 2.5.2
713

8-
# skip installing gem documentation
9-
RUN echo -e 'install: --no-document\nupdate: --no-document' >> "$HOME/.gemrc"
10-
11-
RUN set -x \
14+
# some of ruby's build scripts are written in ruby
15+
# we purge this later to make sure our final image uses what we just built
16+
RUN set -ex \
1217
&& apk add --no-cache --virtual .ruby-builddeps \
1318
autoconf \
1419
bison \
@@ -40,12 +45,13 @@ RUN set -x \
4045
&& mv "/usr/src/ruby-$RUBY_VERSION" /usr/src/ruby \
4146
&& rm ruby.tar.gz \
4247
&& cd /usr/src/ruby \
48+
&& { echo '#define ENABLE_PATH_CHECK 0'; echo; cat file.c; } > file.c.new && mv file.c.new file.c \
4349
&& autoconf \
4450
# the configure script does not detect isnan/isinf as macros
45-
&& ac_cv_func_isnan=yes ac_cv_func_isinf=yes ./configure --disable-install-doc \
51+
&& ac_cv_func_isnan=yes ac_cv_func_isinf=yes \
52+
./configure --disable-install-doc \
4653
&& make -j"$(nproc)" \
4754
&& make install \
48-
&& gem update --system $RUBYGEMS_VERSION \
4955
&& runDeps="$( \
5056
scanelf --needed --nobanner --recursive /usr/local \
5157
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
@@ -63,17 +69,21 @@ RUN set -x \
6369
procps \
6470
zlib-dev \
6571
&& apk del .ruby-builddeps \
72+
&& gem update --system $RUBYGEMS_VERSION \
6673
&& rm -r /usr/src/ruby
6774

68-
# install things globally, for great justice
69-
ENV GEM_HOME /usr/local/bundle
70-
ENV PATH $GEM_HOME/bin:$PATH
71-
7275
ENV BUNDLER_VERSION 1.11.2
7376

7477
RUN gem install bundler --version "$BUNDLER_VERSION" \
7578
&& bundle config --global path "$GEM_HOME" \
76-
&& bundle config --global bin "$GEM_HOME/bin"
79+
&& bundle config --global bin "$GEM_HOME/bin" \
80+
&& bundle config --global silence_root_warning true
81+
82+
# install things globally, for great justice
83+
ENV GEM_HOME /usr/local/bundle
84+
ENV PATH $GEM_HOME/bin:$PATH
85+
RUN mkdir -p "$GEM_HOME" \
86+
&& chmod 777 "$GEM_HOME"
7787

7888
# don't create ".bundle" in all our apps
7989
ENV BUNDLE_APP_CONFIG $GEM_HOME

2.1/slim/Dockerfile

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,21 @@ RUN apt-get update \
1313
zlib1g-dev \
1414
&& rm -rf /var/lib/apt/lists/*
1515

16+
# skip installing gem documentation
17+
RUN { \
18+
echo 'install: --no-document'; \
19+
echo 'update: --no-document'; \
20+
} >> /usr/local/etc/gemrc
21+
1622
ENV RUBY_MAJOR 2.1
1723
ENV RUBY_VERSION 2.1.8
1824
ENV RUBY_DOWNLOAD_SHA256 afd832b8d5ecb2e3e1477ec6a9408fdf9898ee73e4c5df17a2b2cb36bd1c355d
1925
ENV RUBYGEMS_VERSION 2.5.2
2026

21-
# skip installing gem documentation
22-
RUN echo 'install: --no-document\nupdate: --no-document' >> "$HOME/.gemrc"
23-
2427
# some of ruby's build scripts are written in ruby
2528
# we purge this later to make sure our final image uses what we just built
26-
RUN buildDeps=' \
29+
RUN set -ex \
30+
&& buildDeps=' \
2731
autoconf \
2832
bison \
2933
gcc \
@@ -37,27 +41,23 @@ RUN buildDeps=' \
3741
make \
3842
ruby \
3943
' \
40-
&& set -x \
4144
&& apt-get update \
4245
&& apt-get install -y --no-install-recommends $buildDeps \
4346
&& rm -rf /var/lib/apt/lists/* \
44-
&& mkdir -p /usr/src/ruby \
4547
&& curl -fSL -o ruby.tar.gz "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \
4648
&& echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \
49+
&& mkdir -p /usr/src/ruby \
4750
&& tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \
4851
&& rm ruby.tar.gz \
4952
&& cd /usr/src/ruby \
53+
&& { echo '#define ENABLE_PATH_CHECK 0'; echo; cat file.c; } > file.c.new && mv file.c.new file.c \
5054
&& autoconf \
5155
&& ./configure --disable-install-doc \
5256
&& make -j"$(nproc)" \
5357
&& make install \
58+
&& apt-get purge -y --auto-remove $buildDeps \
5459
&& gem update --system $RUBYGEMS_VERSION \
55-
&& rm -r /usr/src/ruby \
56-
&& apt-get purge -y --auto-remove $buildDeps
57-
58-
# install things globally, for great justice
59-
ENV GEM_HOME /usr/local/bundle
60-
ENV PATH $GEM_HOME/bin:$PATH
60+
&& rm -r /usr/src/ruby
6161

6262
ENV BUNDLER_VERSION 1.11.2
6363

@@ -66,6 +66,12 @@ RUN gem install bundler --version "$BUNDLER_VERSION" \
6666
&& bundle config --global bin "$GEM_HOME/bin" \
6767
&& bundle config --global silence_root_warning true
6868

69+
# install things globally, for great justice
70+
ENV GEM_HOME /usr/local/bundle
71+
ENV PATH $GEM_HOME/bin:$PATH
72+
RUN mkdir -p "$GEM_HOME" \
73+
&& chmod 777 "$GEM_HOME"
74+
6975
# don't create ".bundle" in all our apps
7076
ENV BUNDLE_APP_CONFIG $GEM_HOME
7177

0 commit comments

Comments
 (0)