Skip to content

Commit 802a667

Browse files
committed
Add 2.4-rc builds
1 parent 47a5e9e commit 802a667

File tree

6 files changed

+299
-4
lines changed

6 files changed

+299
-4
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ language: bash
22
services: docker
33

44
env:
5+
- VERSION=2.4-rc VARIANT=
6+
- VERSION=2.4-rc VARIANT=slim
7+
- VERSION=2.4-rc VARIANT=alpine
58
- VERSION=2.3 VARIANT=
69
- VERSION=2.3 VARIANT=slim
710
- VERSION=2.3 VARIANT=alpine

2.4-rc/Dockerfile

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
FROM buildpack-deps:jessie
2+
3+
# skip installing gem documentation
4+
RUN mkdir -p /usr/local/etc \
5+
&& { \
6+
echo 'install: --no-document'; \
7+
echo 'update: --no-document'; \
8+
} >> /usr/local/etc/gemrc
9+
10+
ENV RUBY_MAJOR 2.4-rc
11+
ENV RUBY_VERSION 2.4.0-preview3
12+
ENV RUBY_DOWNLOAD_SHA256 c35fe752ccfabf69bf48e6aab5111c25a05938b428936f780638e2111934c9dd
13+
ENV RUBYGEMS_VERSION 2.6.8
14+
15+
# some of ruby's build scripts are written in ruby
16+
# we purge system ruby later to make sure our final image uses what we just built
17+
RUN set -ex \
18+
\
19+
&& buildDeps=' \
20+
bison \
21+
libgdbm-dev \
22+
ruby \
23+
' \
24+
&& apt-get update \
25+
&& apt-get install -y --no-install-recommends $buildDeps \
26+
&& rm -rf /var/lib/apt/lists/* \
27+
\
28+
&& wget -O ruby.tar.gz "https://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \
29+
&& echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \
30+
\
31+
&& mkdir -p /usr/src/ruby \
32+
&& tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \
33+
&& rm ruby.tar.gz \
34+
\
35+
&& cd /usr/src/ruby \
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+
\
46+
&& autoconf \
47+
&& ./configure --disable-install-doc \
48+
&& make -j"$(nproc)" \
49+
&& make install \
50+
\
51+
&& apt-get purge -y --auto-remove $buildDeps \
52+
&& cd / \
53+
&& rm -r /usr/src/ruby \
54+
\
55+
&& gem update --system "$RUBYGEMS_VERSION"
56+
57+
ENV BUNDLER_VERSION 1.13.6
58+
59+
RUN gem install bundler --version "$BUNDLER_VERSION"
60+
61+
# install things globally, for great justice
62+
# and don't create ".bundle" in all our apps
63+
ENV GEM_HOME /usr/local/bundle
64+
ENV BUNDLE_PATH="$GEM_HOME" \
65+
BUNDLE_BIN="$GEM_HOME/bin" \
66+
BUNDLE_SILENCE_ROOT_WARNING=1 \
67+
BUNDLE_APP_CONFIG="$GEM_HOME"
68+
ENV PATH $BUNDLE_BIN:$PATH
69+
RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
70+
&& chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
71+
72+
CMD [ "irb" ]

2.4-rc/alpine/Dockerfile

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
FROM alpine:3.4
2+
3+
# skip installing gem documentation
4+
RUN mkdir -p /usr/local/etc \
5+
&& { \
6+
echo 'install: --no-document'; \
7+
echo 'update: --no-document'; \
8+
} >> /usr/local/etc/gemrc
9+
10+
ENV RUBY_MAJOR 2.4-rc
11+
ENV RUBY_VERSION 2.4.0-preview3
12+
ENV RUBY_DOWNLOAD_SHA256 c35fe752ccfabf69bf48e6aab5111c25a05938b428936f780638e2111934c9dd
13+
ENV RUBYGEMS_VERSION 2.6.8
14+
15+
# some of ruby's build scripts are written in ruby
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
18+
RUN set -ex \
19+
\
20+
&& apk add --no-cache --virtual .ruby-builddeps \
21+
autoconf \
22+
bison \
23+
bzip2 \
24+
bzip2-dev \
25+
ca-certificates \
26+
coreutils \
27+
gcc \
28+
gdbm-dev \
29+
glib-dev \
30+
libc-dev \
31+
libffi-dev \
32+
libxml2-dev \
33+
libxslt-dev \
34+
linux-headers \
35+
make \
36+
ncurses-dev \
37+
openssl \
38+
openssl-dev \
39+
procps \
40+
readline-dev \
41+
ruby \
42+
tar \
43+
yaml-dev \
44+
zlib-dev \
45+
\
46+
&& wget -O ruby.tar.gz "https://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \
47+
&& echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \
48+
\
49+
&& mkdir -p /usr/src/ruby \
50+
&& tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \
51+
&& rm ruby.tar.gz \
52+
\
53+
&& cd /usr/src/ruby \
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+
\
64+
&& autoconf \
65+
# the configure script does not detect isnan/isinf as macros
66+
&& ac_cv_func_isnan=yes ac_cv_func_isinf=yes \
67+
./configure --disable-install-doc \
68+
&& make -j"$(getconf _NPROCESSORS_ONLN)" \
69+
&& make install \
70+
\
71+
&& runDeps="$( \
72+
scanelf --needed --nobanner --recursive /usr/local \
73+
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
74+
| sort -u \
75+
| xargs -r apk info --installed \
76+
| sort -u \
77+
)" \
78+
&& apk add --virtual .ruby-rundeps $runDeps \
79+
bzip2 \
80+
ca-certificates \
81+
libffi-dev \
82+
openssl-dev \
83+
yaml-dev \
84+
procps \
85+
zlib-dev \
86+
&& apk del .ruby-builddeps \
87+
&& cd / \
88+
&& rm -r /usr/src/ruby \
89+
\
90+
&& gem update --system "$RUBYGEMS_VERSION"
91+
92+
ENV BUNDLER_VERSION 1.13.6
93+
94+
RUN gem install bundler --version "$BUNDLER_VERSION"
95+
96+
# install things globally, for great justice
97+
# and don't create ".bundle" in all our apps
98+
ENV GEM_HOME /usr/local/bundle
99+
ENV BUNDLE_PATH="$GEM_HOME" \
100+
BUNDLE_BIN="$GEM_HOME/bin" \
101+
BUNDLE_SILENCE_ROOT_WARNING=1 \
102+
BUNDLE_APP_CONFIG="$GEM_HOME"
103+
ENV PATH $BUNDLE_BIN:$PATH
104+
RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
105+
&& chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
106+
107+
CMD [ "irb" ]

2.4-rc/onbuild/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM ruby:2.4-rc
2+
3+
# throw errors if Gemfile has been modified since Gemfile.lock
4+
RUN bundle config --global frozen 1
5+
6+
RUN mkdir -p /usr/src/app
7+
WORKDIR /usr/src/app
8+
9+
ONBUILD COPY Gemfile /usr/src/app/
10+
ONBUILD COPY Gemfile.lock /usr/src/app/
11+
ONBUILD RUN bundle install
12+
13+
ONBUILD COPY . /usr/src/app

2.4-rc/slim/Dockerfile

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
FROM debian:jessie
2+
3+
RUN apt-get update \
4+
&& apt-get install -y --no-install-recommends \
5+
bzip2 \
6+
ca-certificates \
7+
libffi-dev \
8+
libgdbm3 \
9+
libssl-dev \
10+
libyaml-dev \
11+
procps \
12+
zlib1g-dev \
13+
&& rm -rf /var/lib/apt/lists/*
14+
15+
# skip installing gem documentation
16+
RUN mkdir -p /usr/local/etc \
17+
&& { \
18+
echo 'install: --no-document'; \
19+
echo 'update: --no-document'; \
20+
} >> /usr/local/etc/gemrc
21+
22+
ENV RUBY_MAJOR 2.4-rc
23+
ENV RUBY_VERSION 2.4.0-preview3
24+
ENV RUBY_DOWNLOAD_SHA256 c35fe752ccfabf69bf48e6aab5111c25a05938b428936f780638e2111934c9dd
25+
ENV RUBYGEMS_VERSION 2.6.8
26+
27+
# some of ruby's build scripts are written in ruby
28+
# we purge system ruby later to make sure our final image uses what we just built
29+
RUN set -ex \
30+
\
31+
&& buildDeps=' \
32+
autoconf \
33+
bison \
34+
gcc \
35+
libbz2-dev \
36+
libgdbm-dev \
37+
libglib2.0-dev \
38+
libncurses-dev \
39+
libreadline-dev \
40+
libxml2-dev \
41+
libxslt-dev \
42+
make \
43+
ruby \
44+
wget \
45+
' \
46+
&& apt-get update \
47+
&& apt-get install -y --no-install-recommends $buildDeps \
48+
&& rm -rf /var/lib/apt/lists/* \
49+
\
50+
&& wget -O ruby.tar.gz "https://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \
51+
&& echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \
52+
\
53+
&& mkdir -p /usr/src/ruby \
54+
&& tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \
55+
&& rm ruby.tar.gz \
56+
\
57+
&& cd /usr/src/ruby \
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+
\
68+
&& autoconf \
69+
&& ./configure --disable-install-doc \
70+
&& make -j"$(nproc)" \
71+
&& make install \
72+
\
73+
&& apt-get purge -y --auto-remove $buildDeps \
74+
&& cd / \
75+
&& rm -r /usr/src/ruby \
76+
\
77+
&& gem update --system "$RUBYGEMS_VERSION"
78+
79+
ENV BUNDLER_VERSION 1.13.6
80+
81+
RUN gem install bundler --version "$BUNDLER_VERSION"
82+
83+
# install things globally, for great justice
84+
# and don't create ".bundle" in all our apps
85+
ENV GEM_HOME /usr/local/bundle
86+
ENV BUNDLE_PATH="$GEM_HOME" \
87+
BUNDLE_BIN="$GEM_HOME/bin" \
88+
BUNDLE_SILENCE_ROOT_WARNING=1 \
89+
BUNDLE_APP_CONFIG="$GEM_HOME"
90+
ENV PATH $BUNDLE_BIN:$PATH
91+
RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
92+
&& chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
93+
94+
CMD [ "irb" ]

update.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,16 @@ bundler="$(latest_gem_version bundler)"
1919

2020
travisEnv=
2121
for version in "${versions[@]}"; do
22+
rcGrepV='-v'
23+
rcVersion="${version%-rc}"
24+
if [ "$rcVersion" != "$version" ]; then
25+
rcGrepV=
26+
fi
27+
2228
IFS=$'\n'; allVersions=(
23-
$(curl -sSL --compressed "https://cache.ruby-lang.org/pub/ruby/$version/" \
24-
| grep -E '<a href="ruby-'"$version"'.[^"]+\.tar\.bz2' \
25-
| grep -vE 'preview|rc' \
29+
$(curl -sSL --compressed "https://cache.ruby-lang.org/pub/ruby/$rcVersion/" \
30+
| grep -E '<a href="ruby-'"$rcVersion"'.[^"]+\.tar\.bz2' \
31+
| grep $rcGrepV -E 'preview|rc' \
2632
| sed -r 's!.*<a href="ruby-([^"]+)\.tar\.bz2.*!\1!' \
2733
| sort -rV)
2834
); unset IFS
@@ -42,7 +48,7 @@ for version in "${versions[@]}"; do
4248
shaVal="$(echo "$shaPage" | sed -r "s/.*Ruby ${fullVersion}<\/a><br \/>\s*sha256: ([^<]+).*/\1/")"
4349

4450
sedStr="
45-
s!%%VERSION%%!$version!g;
51+
s!%%VERSION%%!$rcVersion!g;
4652
s!%%FULL_VERSION%%!$fullVersion!g;
4753
s!%%SHA256%%!$shaVal!g;
4854
s!%%RUBYGEMS%%!$rubygems!g;

0 commit comments

Comments
 (0)