-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.template.patch
More file actions
60 lines (59 loc) · 2.08 KB
/
Dockerfile.template.patch
File metadata and controls
60 lines (59 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
diff --git a/Dockerfile.template b/Dockerfile.template
index 9f9a685..5134250 100644
--- a/Dockerfile.template
+++ b/Dockerfile.template
@@ -36,7 +36,8 @@ ENV RUBY_DOWNLOAD_SHA256 {{ .sha256.xz }}
# some of ruby's build scripts are written in ruby
# we purge system ruby later to make sure our final image uses what we just built
-RUN set -eux; \
+RUN --mount=type=bind,source=ruby.tar.xz,target=ruby.tar.xz \
+ set -eux; \
\
{{ if is_alpine then ( -}}
apk add --no-cache --virtual .ruby-builddeps \
@@ -52,6 +53,7 @@ RUN set -eux; \
dpkg-dev dpkg \
g++ \
gcc \
+ git \
gdbm-dev \
glib-dev \
gmp-dev \
@@ -93,6 +95,7 @@ RUN set -eux; \
bzip2 \
g++ \
gcc \
+ git \
libbz2-dev \
libffi-dev \
libgdbm-compat-dev \
@@ -181,12 +184,10 @@ RUN set -eux; \
cargo --version; \
fi; \
\
- wget -O ruby.tar.xz "$RUBY_DOWNLOAD_URL"; \
echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.xz" | sha256sum --check --strict; \
\
mkdir -p /usr/src/ruby; \
tar -xJf ruby.tar.xz -C /usr/src/ruby --strip-components=1; \
- rm ruby.tar.xz; \
\
cd /usr/src/ruby; \
\
@@ -194,7 +195,7 @@ RUN set -eux; \
# https://github.com/docker-library/ruby/issues/196
# https://bugs.ruby-lang.org/issues/14387#note-13 (patch source)
# 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)
- 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'; \
+ wget -O 'thread-stack-fix.patch' 'https://raw.githubusercontent.com/docker-ruby-nightly/ruby/master/thread-stack-fix.patch'; \
echo '3ab628a51d92fdf0d2b5835e93564857aea73e0c1de00313864a94a6255cb645 *thread-stack-fix.patch' | sha256sum --check --strict; \
patch -p1 -i thread-stack-fix.patch; \
rm thread-stack-fix.patch; \
@@ -203,6 +204,7 @@ RUN set -eux; \
autoconf; \
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
./configure \
+ cppflags="-DRUBY_DEBUG=1" \
--build="$gnuArch" \
--disable-install-doc \
--enable-shared \