File tree Expand file tree Collapse file tree 2 files changed +30
-3
lines changed Expand file tree Collapse file tree 2 files changed +30
-3
lines changed Original file line number Diff line number Diff line change @@ -13,11 +13,14 @@ CRYSTAL_TARGZ ?= ## Which crystal.tar.gz file to install in docker images (a
13
13
DOCKER_TAG ?= # # How to tag the docker image (examples: `0.27.2`, `nightly20190307`). `-build` will be appended for build images.
14
14
DOCKER_REPOSITORY ?= # # Docker hub repository to commit image
15
15
16
+ GC_VERSION = v8.0.4
17
+ LIBATOMIC_OPS_VERSION = v7.6.10
18
+
16
19
OUTPUT_DIR := build
17
20
BUILD_CONTEXT := $(CURDIR ) /build-context
18
21
BUILD_ARGS_UBUNTU64 := --build-arg crystal_deb=crystal.deb $(BUILD_CONTEXT ) /ubuntu64 --build-arg base_docker_image=ubuntu:focal
19
22
BUILD_ARGS_UBUNTU32 := --build-arg crystal_deb=crystal.deb $(BUILD_CONTEXT ) /ubuntu32 --build-arg base_docker_image=i386/ubuntu:bionic
20
- BUILD_ARGS_ALPINE := --build-arg crystal_targz=crystal.tar.gz $(BUILD_CONTEXT ) /alpine
23
+ BUILD_ARGS_ALPINE := --build-arg crystal_targz=crystal.tar.gz $(BUILD_CONTEXT ) /alpine --build-arg gc_version= $( GC_VERSION ) --build-arg libatomic_ops_version= $( LIBATOMIC_OPS_VERSION )
21
24
DOCKER_TAG_UBUNTU := $(DOCKER_REPOSITORY ) :$(DOCKER_TAG )
22
25
DOCKER_TAG_ALPINE := $(DOCKER_REPOSITORY ) :$(DOCKER_TAG ) -alpine
23
26
@@ -53,6 +56,8 @@ $(BUILD_CONTEXT)/ubuntu64: ubuntu.Dockerfile $(BUILD_CONTEXT)/ubuntu64/crystal.d
53
56
54
57
$(BUILD_CONTEXT ) /alpine : alpine.Dockerfile $(BUILD_CONTEXT ) /alpine/crystal.tar.gz
55
58
cp alpine.Dockerfile $@ /Dockerfile
59
+ mkdir $@ /files/
60
+ cp ../linux/files/feature-thread-stackbottom-upstream.patch $@ /files/feature-thread-stackbottom-upstream.patch
56
61
57
62
% /crystal.deb :
58
63
mkdir -p $(shell dirname $@ )
Original file line number Diff line number Diff line change @@ -3,11 +3,33 @@ FROM alpine:3.13 as runtime
3
3
RUN \
4
4
apk add --update --no-cache --force-overwrite \
5
5
# core dependencies
6
- gc-dev gcc gmp-dev libatomic_ops libevent-static musl-dev pcre-dev \
6
+ gcc gmp-dev libevent-static musl-dev pcre-dev \
7
7
# stdlib dependencies
8
8
libxml2-dev openssl-dev openssl-libs-static tzdata yaml-static zlib-static \
9
9
# dev tools
10
- make git
10
+ make git \
11
+ # build libgc dependencies
12
+ autoconf automake libtool patch
13
+
14
+ # Build libgc
15
+ ARG gc_version
16
+ ARG libatomic_ops_version
17
+ COPY files/feature-thread-stackbottom-upstream.patch /tmp/
18
+ RUN git clone https://github.com/ivmai/bdwgc \
19
+ && cd bdwgc \
20
+ && git checkout ${gc_version} \
21
+ && git clone https://github.com/ivmai/libatomic_ops \
22
+ && (cd libatomic_ops && git checkout ${libatomic_ops_version}) \
23
+ \
24
+ && patch -p1 < /tmp/feature-thread-stackbottom-upstream.patch \
25
+ \
26
+ && ./autogen.sh \
27
+ && ./configure --disable-debug --disable-shared --enable-large-config \
28
+ && make -j$(nproc) CFLAGS=-DNO_GETCONTEXT \
29
+ && make install
30
+
31
+ # Remove build tools from image now that libgc is built
32
+ RUN apk del -r --purge autoconf automake libtool patch
11
33
12
34
ARG crystal_targz
13
35
COPY ${crystal_targz} /tmp/crystal.tar.gz
You can’t perform that action at this time.
0 commit comments