Skip to content

Commit 281978e

Browse files
committed
Apply update.sh
1 parent d85cf42 commit 281978e

File tree

9 files changed

+210
-69
lines changed

9 files changed

+210
-69
lines changed

2.1/Dockerfile

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ ENV RUBY_DOWNLOAD_SHA256 fb2e454d7a5e5a39eb54db0ec666f53eeb6edc593d1d2b970ae4d15
1313
ENV RUBYGEMS_VERSION 2.6.6
1414

1515
# some of ruby's build scripts are written in ruby
16-
# we purge this later to make sure our final image uses what we just built
16+
# we purge system ruby later to make sure our final image uses what we just built
1717
RUN set -ex \
18+
\
1819
&& buildDeps=' \
1920
bison \
2021
libgdbm-dev \
@@ -23,20 +24,35 @@ RUN set -ex \
2324
&& apt-get update \
2425
&& apt-get install -y --no-install-recommends $buildDeps \
2526
&& rm -rf /var/lib/apt/lists/* \
26-
&& curl -fSL -o ruby.tar.gz "https://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \
27+
\
28+
&& wget -O ruby.tar.gz "https://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \
2729
&& echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \
30+
\
2831
&& mkdir -p /usr/src/ruby \
2932
&& tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \
3033
&& rm ruby.tar.gz \
34+
\
3135
&& cd /usr/src/ruby \
32-
&& { echo '#define ENABLE_PATH_CHECK 0'; echo; cat file.c; } > file.c.new && mv file.c.new file.c \
36+
\
37+
# hack in "ENABLE_PATH_CHECK" disabling to suppress:
38+
# warning: Insecure world writable dir
39+
&& { \
40+
echo '#define ENABLE_PATH_CHECK 0'; \
41+
echo; \
42+
cat file.c; \
43+
} > file.c.new \
44+
&& mv file.c.new file.c \
45+
\
3346
&& autoconf \
3447
&& ./configure --disable-install-doc \
3548
&& make -j"$(nproc)" \
3649
&& make install \
50+
\
3751
&& apt-get purge -y --auto-remove $buildDeps \
38-
&& gem update --system $RUBYGEMS_VERSION \
39-
&& rm -r /usr/src/ruby
52+
&& cd / \
53+
&& rm -r /usr/src/ruby \
54+
\
55+
&& gem update --system "$RUBYGEMS_VERSION"
4056

4157
ENV BUNDLER_VERSION 1.13.1
4258

2.1/alpine/Dockerfile

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,17 @@ ENV RUBY_DOWNLOAD_SHA256 fb2e454d7a5e5a39eb54db0ec666f53eeb6edc593d1d2b970ae4d15
1313
ENV RUBYGEMS_VERSION 2.6.6
1414

1515
# some of ruby's build scripts are written in ruby
16-
# we purge this later to make sure our final image uses what we just built
16+
# we purge system ruby later to make sure our final image uses what we just built
17+
# readline-dev vs libedit-dev: https://bugs.ruby-lang.org/issues/11869 and https://github.com/docker-library/ruby/issues/75
1718
RUN set -ex \
19+
\
1820
&& apk add --no-cache --virtual .ruby-builddeps \
1921
autoconf \
2022
bison \
2123
bzip2 \
2224
bzip2-dev \
2325
ca-certificates \
2426
coreutils \
25-
curl \
2627
gcc \
2728
gdbm-dev \
2829
glib-dev \
@@ -33,27 +34,40 @@ RUN set -ex \
3334
linux-headers \
3435
make \
3536
ncurses-dev \
37+
openssl \
3638
openssl-dev \
3739
procps \
38-
# https://bugs.ruby-lang.org/issues/11869 and https://github.com/docker-library/ruby/issues/75
3940
readline-dev \
4041
ruby \
42+
tar \
4143
yaml-dev \
4244
zlib-dev \
43-
&& curl -fSL -o ruby.tar.gz "https://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \
45+
\
46+
&& wget -O ruby.tar.gz "https://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \
4447
&& echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \
45-
&& mkdir -p /usr/src \
46-
&& tar -xzf ruby.tar.gz -C /usr/src \
47-
&& mv "/usr/src/ruby-$RUBY_VERSION" /usr/src/ruby \
48+
\
49+
&& mkdir -p /usr/src/ruby \
50+
&& tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \
4851
&& rm ruby.tar.gz \
52+
\
4953
&& cd /usr/src/ruby \
50-
&& { echo '#define ENABLE_PATH_CHECK 0'; echo; cat file.c; } > file.c.new && mv file.c.new file.c \
54+
\
55+
# hack in "ENABLE_PATH_CHECK" disabling to suppress:
56+
# warning: Insecure world writable dir
57+
&& { \
58+
echo '#define ENABLE_PATH_CHECK 0'; \
59+
echo; \
60+
cat file.c; \
61+
} > file.c.new \
62+
&& mv file.c.new file.c \
63+
\
5164
&& autoconf \
52-
# the configure script does not detect isnan/isinf as macros
65+
# the configure script does not detect isnan/isinf as macros
5366
&& ac_cv_func_isnan=yes ac_cv_func_isinf=yes \
5467
./configure --disable-install-doc \
5568
&& make -j"$(getconf _NPROCESSORS_ONLN)" \
5669
&& make install \
70+
\
5771
&& runDeps="$( \
5872
scanelf --needed --nobanner --recursive /usr/local \
5973
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
@@ -64,15 +78,16 @@ RUN set -ex \
6478
&& apk add --virtual .ruby-rundeps $runDeps \
6579
bzip2 \
6680
ca-certificates \
67-
curl \
6881
libffi-dev \
6982
openssl-dev \
7083
yaml-dev \
7184
procps \
7285
zlib-dev \
7386
&& apk del .ruby-builddeps \
74-
&& gem update --system $RUBYGEMS_VERSION \
75-
&& rm -r /usr/src/ruby
87+
&& cd / \
88+
&& rm -r /usr/src/ruby \
89+
\
90+
&& gem update --system "$RUBYGEMS_VERSION"
7691

7792
ENV BUNDLER_VERSION 1.13.1
7893

2.1/slim/Dockerfile

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ RUN apt-get update \
44
&& apt-get install -y --no-install-recommends \
55
bzip2 \
66
ca-certificates \
7-
curl \
87
libffi-dev \
98
libgdbm3 \
109
libssl-dev \
@@ -26,8 +25,9 @@ ENV RUBY_DOWNLOAD_SHA256 fb2e454d7a5e5a39eb54db0ec666f53eeb6edc593d1d2b970ae4d15
2625
ENV RUBYGEMS_VERSION 2.6.6
2726

2827
# some of ruby's build scripts are written in ruby
29-
# we purge this later to make sure our final image uses what we just built
28+
# we purge system ruby later to make sure our final image uses what we just built
3029
RUN set -ex \
30+
\
3131
&& buildDeps=' \
3232
autoconf \
3333
bison \
@@ -41,24 +41,40 @@ RUN set -ex \
4141
libxslt-dev \
4242
make \
4343
ruby \
44+
wget \
4445
' \
4546
&& apt-get update \
4647
&& apt-get install -y --no-install-recommends $buildDeps \
4748
&& rm -rf /var/lib/apt/lists/* \
48-
&& curl -fSL -o ruby.tar.gz "https://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \
49+
\
50+
&& wget -O ruby.tar.gz "https://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \
4951
&& echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \
52+
\
5053
&& mkdir -p /usr/src/ruby \
5154
&& tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \
5255
&& rm ruby.tar.gz \
56+
\
5357
&& cd /usr/src/ruby \
54-
&& { echo '#define ENABLE_PATH_CHECK 0'; echo; cat file.c; } > file.c.new && mv file.c.new file.c \
58+
\
59+
# hack in "ENABLE_PATH_CHECK" disabling to suppress:
60+
# warning: Insecure world writable dir
61+
&& { \
62+
echo '#define ENABLE_PATH_CHECK 0'; \
63+
echo; \
64+
cat file.c; \
65+
} > file.c.new \
66+
&& mv file.c.new file.c \
67+
\
5568
&& autoconf \
5669
&& ./configure --disable-install-doc \
5770
&& make -j"$(nproc)" \
5871
&& make install \
72+
\
5973
&& apt-get purge -y --auto-remove $buildDeps \
60-
&& gem update --system $RUBYGEMS_VERSION \
61-
&& rm -r /usr/src/ruby
74+
&& cd / \
75+
&& rm -r /usr/src/ruby \
76+
\
77+
&& gem update --system "$RUBYGEMS_VERSION"
6278

6379
ENV BUNDLER_VERSION 1.13.1
6480

2.2/Dockerfile

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ ENV RUBY_DOWNLOAD_SHA256 30c4b31697a4ca4ea0c8db8ad30cf45e6690a0f09687e5d483c933c
1313
ENV RUBYGEMS_VERSION 2.6.6
1414

1515
# some of ruby's build scripts are written in ruby
16-
# we purge this later to make sure our final image uses what we just built
16+
# we purge system ruby later to make sure our final image uses what we just built
1717
RUN set -ex \
18+
\
1819
&& buildDeps=' \
1920
bison \
2021
libgdbm-dev \
@@ -23,20 +24,35 @@ RUN set -ex \
2324
&& apt-get update \
2425
&& apt-get install -y --no-install-recommends $buildDeps \
2526
&& rm -rf /var/lib/apt/lists/* \
26-
&& curl -fSL -o ruby.tar.gz "https://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \
27+
\
28+
&& wget -O ruby.tar.gz "https://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \
2729
&& echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \
30+
\
2831
&& mkdir -p /usr/src/ruby \
2932
&& tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \
3033
&& rm ruby.tar.gz \
34+
\
3135
&& cd /usr/src/ruby \
32-
&& { echo '#define ENABLE_PATH_CHECK 0'; echo; cat file.c; } > file.c.new && mv file.c.new file.c \
36+
\
37+
# hack in "ENABLE_PATH_CHECK" disabling to suppress:
38+
# warning: Insecure world writable dir
39+
&& { \
40+
echo '#define ENABLE_PATH_CHECK 0'; \
41+
echo; \
42+
cat file.c; \
43+
} > file.c.new \
44+
&& mv file.c.new file.c \
45+
\
3346
&& autoconf \
3447
&& ./configure --disable-install-doc \
3548
&& make -j"$(nproc)" \
3649
&& make install \
50+
\
3751
&& apt-get purge -y --auto-remove $buildDeps \
38-
&& gem update --system $RUBYGEMS_VERSION \
39-
&& rm -r /usr/src/ruby
52+
&& cd / \
53+
&& rm -r /usr/src/ruby \
54+
\
55+
&& gem update --system "$RUBYGEMS_VERSION"
4056

4157
ENV BUNDLER_VERSION 1.13.1
4258

2.2/alpine/Dockerfile

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,17 @@ ENV RUBY_DOWNLOAD_SHA256 30c4b31697a4ca4ea0c8db8ad30cf45e6690a0f09687e5d483c933c
1313
ENV RUBYGEMS_VERSION 2.6.6
1414

1515
# some of ruby's build scripts are written in ruby
16-
# we purge this later to make sure our final image uses what we just built
16+
# we purge system ruby later to make sure our final image uses what we just built
17+
# readline-dev vs libedit-dev: https://bugs.ruby-lang.org/issues/11869 and https://github.com/docker-library/ruby/issues/75
1718
RUN set -ex \
19+
\
1820
&& apk add --no-cache --virtual .ruby-builddeps \
1921
autoconf \
2022
bison \
2123
bzip2 \
2224
bzip2-dev \
2325
ca-certificates \
2426
coreutils \
25-
curl \
2627
gcc \
2728
gdbm-dev \
2829
glib-dev \
@@ -33,27 +34,40 @@ RUN set -ex \
3334
linux-headers \
3435
make \
3536
ncurses-dev \
37+
openssl \
3638
openssl-dev \
3739
procps \
38-
# https://bugs.ruby-lang.org/issues/11869 and https://github.com/docker-library/ruby/issues/75
3940
readline-dev \
4041
ruby \
42+
tar \
4143
yaml-dev \
4244
zlib-dev \
43-
&& curl -fSL -o ruby.tar.gz "https://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \
45+
\
46+
&& wget -O ruby.tar.gz "https://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \
4447
&& echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \
45-
&& mkdir -p /usr/src \
46-
&& tar -xzf ruby.tar.gz -C /usr/src \
47-
&& mv "/usr/src/ruby-$RUBY_VERSION" /usr/src/ruby \
48+
\
49+
&& mkdir -p /usr/src/ruby \
50+
&& tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \
4851
&& rm ruby.tar.gz \
52+
\
4953
&& cd /usr/src/ruby \
50-
&& { echo '#define ENABLE_PATH_CHECK 0'; echo; cat file.c; } > file.c.new && mv file.c.new file.c \
54+
\
55+
# hack in "ENABLE_PATH_CHECK" disabling to suppress:
56+
# warning: Insecure world writable dir
57+
&& { \
58+
echo '#define ENABLE_PATH_CHECK 0'; \
59+
echo; \
60+
cat file.c; \
61+
} > file.c.new \
62+
&& mv file.c.new file.c \
63+
\
5164
&& autoconf \
52-
# the configure script does not detect isnan/isinf as macros
65+
# the configure script does not detect isnan/isinf as macros
5366
&& ac_cv_func_isnan=yes ac_cv_func_isinf=yes \
5467
./configure --disable-install-doc \
5568
&& make -j"$(getconf _NPROCESSORS_ONLN)" \
5669
&& make install \
70+
\
5771
&& runDeps="$( \
5872
scanelf --needed --nobanner --recursive /usr/local \
5973
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
@@ -64,15 +78,16 @@ RUN set -ex \
6478
&& apk add --virtual .ruby-rundeps $runDeps \
6579
bzip2 \
6680
ca-certificates \
67-
curl \
6881
libffi-dev \
6982
openssl-dev \
7083
yaml-dev \
7184
procps \
7285
zlib-dev \
7386
&& apk del .ruby-builddeps \
74-
&& gem update --system $RUBYGEMS_VERSION \
75-
&& rm -r /usr/src/ruby
87+
&& cd / \
88+
&& rm -r /usr/src/ruby \
89+
\
90+
&& gem update --system "$RUBYGEMS_VERSION"
7691

7792
ENV BUNDLER_VERSION 1.13.1
7893

0 commit comments

Comments
 (0)