Skip to content

Commit 68f67b0

Browse files
authored
Merge pull request #281 from J0WI/alpine10
Add Alpine 3.10 and remove Alpine 3.8
2 parents 8435142 + 486c315 commit 68f67b0

File tree

6 files changed

+132
-20
lines changed

6 files changed

+132
-20
lines changed

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,22 @@ services: docker
44
env:
55
- VERSION=2.7-rc VARIANT=stretch
66
- VERSION=2.7-rc VARIANT=stretch/slim
7+
- VERSION=2.7-rc VARIANT=alpine3.10
78
- VERSION=2.7-rc VARIANT=alpine3.9
89
- VERSION=2.6 VARIANT=stretch
910
- VERSION=2.6 VARIANT=stretch/slim
11+
- VERSION=2.6 VARIANT=alpine3.10
1012
- VERSION=2.6 VARIANT=alpine3.9
11-
- VERSION=2.6 VARIANT=alpine3.8
1213
- VERSION=2.5 VARIANT=stretch
1314
- VERSION=2.5 VARIANT=stretch/slim
15+
- VERSION=2.5 VARIANT=alpine3.10
1416
- VERSION=2.5 VARIANT=alpine3.9
15-
- VERSION=2.5 VARIANT=alpine3.8
1617
- VERSION=2.4 VARIANT=stretch
1718
- VERSION=2.4 VARIANT=stretch/slim
1819
- VERSION=2.4 VARIANT=jessie
1920
- VERSION=2.4 VARIANT=jessie/slim
21+
- VERSION=2.4 VARIANT=alpine3.10
2022
- VERSION=2.4 VARIANT=alpine3.9
21-
- VERSION=2.4 VARIANT=alpine3.8
2223

2324
install:
2425
- git clone --depth 1 https://github.com/docker-library/official-images.git ~/official-images

2.4/alpine3.8/Dockerfile renamed to 2.4/alpine3.10/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:3.8
1+
FROM alpine:3.10
22

33
RUN apk add --no-cache \
44
gmp-dev
@@ -38,8 +38,8 @@ RUN set -ex \
3838
linux-headers \
3939
make \
4040
ncurses-dev \
41-
libressl \
42-
libressl-dev \
41+
openssl \
42+
openssl-dev \
4343
procps \
4444
readline-dev \
4545
ruby \

2.5/alpine3.8/Dockerfile renamed to 2.5/alpine3.10/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:3.8
1+
FROM alpine:3.10
22

33
RUN apk add --no-cache \
44
gmp-dev
@@ -38,8 +38,8 @@ RUN set -ex \
3838
linux-headers \
3939
make \
4040
ncurses-dev \
41-
libressl \
42-
libressl-dev \
41+
openssl \
42+
openssl-dev \
4343
procps \
4444
readline-dev \
4545
ruby \

2.6/alpine3.8/Dockerfile renamed to 2.6/alpine3.10/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:3.8
1+
FROM alpine:3.10
22

33
RUN apk add --no-cache \
44
gmp-dev
@@ -37,8 +37,8 @@ RUN set -ex \
3737
linux-headers \
3838
make \
3939
ncurses-dev \
40-
libressl \
41-
libressl-dev \
40+
openssl \
41+
openssl-dev \
4242
procps \
4343
readline-dev \
4444
ruby \

2.7-rc/alpine3.10/Dockerfile

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
FROM alpine:3.10
2+
3+
RUN apk add --no-cache \
4+
gmp-dev
5+
6+
# skip installing gem documentation
7+
RUN mkdir -p /usr/local/etc \
8+
&& { \
9+
echo 'install: --no-document'; \
10+
echo 'update: --no-document'; \
11+
} >> /usr/local/etc/gemrc
12+
13+
ENV RUBY_MAJOR 2.7-rc
14+
ENV RUBY_VERSION 2.7.0-preview1
15+
ENV RUBY_DOWNLOAD_SHA256 8c546df3345398b3edc9d0ab097846f033783d33762889fd0f3dc8bb465c3354
16+
17+
# some of ruby's build scripts are written in ruby
18+
# we purge system ruby later to make sure our final image uses what we just built
19+
# readline-dev vs libedit-dev: https://bugs.ruby-lang.org/issues/11869 and https://github.com/docker-library/ruby/issues/75
20+
RUN set -ex \
21+
\
22+
&& apk add --no-cache --virtual .ruby-builddeps \
23+
autoconf \
24+
bison \
25+
bzip2 \
26+
bzip2-dev \
27+
ca-certificates \
28+
coreutils \
29+
dpkg-dev dpkg \
30+
gcc \
31+
gdbm-dev \
32+
glib-dev \
33+
libc-dev \
34+
libffi-dev \
35+
libxml2-dev \
36+
libxslt-dev \
37+
linux-headers \
38+
make \
39+
ncurses-dev \
40+
openssl \
41+
openssl-dev \
42+
procps \
43+
readline-dev \
44+
ruby \
45+
tar \
46+
xz \
47+
yaml-dev \
48+
zlib-dev \
49+
\
50+
&& wget -O ruby.tar.xz "https://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR%-rc}/ruby-$RUBY_VERSION.tar.xz" \
51+
&& echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.xz" | sha256sum -c - \
52+
\
53+
&& mkdir -p /usr/src/ruby \
54+
&& tar -xJf ruby.tar.xz -C /usr/src/ruby --strip-components=1 \
55+
&& rm ruby.tar.xz \
56+
\
57+
&& cd /usr/src/ruby \
58+
\
59+
# https://github.com/docker-library/ruby/issues/196
60+
# https://bugs.ruby-lang.org/issues/14387#note-13 (patch source)
61+
# https://bugs.ruby-lang.org/issues/14387#note-16 ("Therefore ncopa's patch looks good for me in general." -- only breaks glibc which doesn't matter here)
62+
&& wget -O 'thread-stack-fix.patch' 'https://bugs.ruby-lang.org/attachments/download/7081/0001-thread_pthread.c-make-get_main_stack-portable-on-lin.patch' \
63+
&& echo '3ab628a51d92fdf0d2b5835e93564857aea73e0c1de00313864a94a6255cb645 *thread-stack-fix.patch' | sha256sum -c - \
64+
&& patch -p1 -i thread-stack-fix.patch \
65+
&& rm thread-stack-fix.patch \
66+
\
67+
# hack in "ENABLE_PATH_CHECK" disabling to suppress:
68+
# warning: Insecure world writable dir
69+
&& { \
70+
echo '#define ENABLE_PATH_CHECK 0'; \
71+
echo; \
72+
cat file.c; \
73+
} > file.c.new \
74+
&& mv file.c.new file.c \
75+
\
76+
&& autoconf \
77+
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
78+
# the configure script does not detect isnan/isinf as macros
79+
&& export ac_cv_func_isnan=yes ac_cv_func_isinf=yes \
80+
&& ./configure \
81+
--build="$gnuArch" \
82+
--disable-install-doc \
83+
--enable-shared \
84+
&& make -j "$(nproc)" \
85+
&& make install \
86+
\
87+
&& runDeps="$( \
88+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
89+
| tr ',' '\n' \
90+
| sort -u \
91+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
92+
)" \
93+
&& apk add --no-network --virtual .ruby-rundeps $runDeps \
94+
bzip2 \
95+
ca-certificates \
96+
libffi-dev \
97+
procps \
98+
yaml-dev \
99+
zlib-dev \
100+
&& apk del --no-network .ruby-builddeps \
101+
&& cd / \
102+
&& rm -r /usr/src/ruby \
103+
# rough smoke test
104+
&& ruby --version && gem --version && bundle --version
105+
106+
# install things globally, for great justice
107+
# and don't create ".bundle" in all our apps
108+
ENV GEM_HOME /usr/local/bundle
109+
ENV BUNDLE_PATH="$GEM_HOME" \
110+
BUNDLE_SILENCE_ROOT_WARNING=1 \
111+
BUNDLE_APP_CONFIG="$GEM_HOME"
112+
# path recommendation: https://github.com/bundler/bundler/pull/6469#issuecomment-383235438
113+
ENV PATH $GEM_HOME/bin:$BUNDLE_PATH/gems/bin:$PATH
114+
# adjust permissions of a few directories for running "gem install" as an arbitrary user
115+
RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME"
116+
# (BUNDLE_PATH = GEM_HOME, no need to mkdir/chown both)
117+
118+
CMD [ "irb" ]

update.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ for version in "${versions[@]}"; do
7171
echo "$version: $fullVersion; $shaVal"
7272

7373
for v in \
74-
alpine{3.7,3.8,3.9} \
74+
alpine{3.9,3.10} \
7575
{jessie,stretch}{/slim,} \
7676
; do
7777
dir="$version/$v"
@@ -98,13 +98,6 @@ for version in "${versions[@]}"; do
9898
-e 's/^(FROM (debian|buildpack-deps|alpine)):.*/\1:'"$tag"'/' \
9999
"$template" > "$dir/Dockerfile"
100100

101-
case "$variant" in
102-
alpine3.8 | alpine3.7)
103-
# Alpine 3.9+ uses OpenSSL, but 3.8/3.7 still uses LibreSSL
104-
sed -ri -e 's/openssl/libressl/g' "$dir/Dockerfile"
105-
;;
106-
esac
107-
108101
if [ -n "${newEnoughRubygems[$rcVersion]:-}" ]; then
109102
sed -ri -e '/RUBYGEMS_VERSION/d' "$dir/Dockerfile"
110103
fi

0 commit comments

Comments
 (0)