-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.arm
66 lines (50 loc) · 1.99 KB
/
Dockerfile.arm
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
61
62
63
FROM --platform=linux/amd64 debian as host_builder
RUN uname -a
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Kiev
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt update && apt install -y curl
RUN curl -fsSL https://crystal-lang.org/install.sh | bash
RUN apt update && apt-get install -y \
automake build-essential git libbsd-dev libedit-dev \
libevent-dev libgmp-dev libgmpxx4ldbl libpcre3-dev \
libssl-dev libtool libxml2-dev libyaml-dev \
lld llvm-14 llvm-14-dev
RUN git clone -b v8.2.0 https://github.com/ivmai/bdwgc.git && \
cd bdwgc && \
git clone https://github.com/ivmai/libatomic_ops.git && \
./autogen.sh && \
./configure && \
make -j && \
make check && \
make install
RUN git clone --branch 1.4.0 https://github.com/crystal-lang/crystal
RUN cd crystal && \
make FLAGS="--stats --cross-compile --target arm-linux-gnueabihf --static --release"
FROM --platform=linux/arm/v5 arm32v5/debian as target_builder
RUN uname -a
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Kiev
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt update && apt-get install -y \
automake build-essential git libbsd-dev libedit-dev \
libevent-dev libgmp-dev libgmpxx4ldbl libpcre3-dev \
libssl-dev libtool libxml2-dev libyaml-dev \
lld llvm-14 llvm-14-dev
RUN git clone -b v8.2.0 https://github.com/ivmai/bdwgc.git && \
cd bdwgc && \
git clone https://github.com/ivmai/libatomic_ops.git && \
./autogen.sh && \
./configure && \
make -j && \
make check && \
make install
COPY --from=host_builder /crystal /crystal
RUN cp /crystal/.build/crystal.o /crystal.o
RUN cd /crystal && \
git clean -dfx && \
make deps
RUN cc /crystal.o -o /crystal_bin -rdynamic -static \
/crystal/src/llvm/ext/llvm_ext.o \
`"/usr/bin/llvm-config" --libs --system-libs --ldflags --link-static 2> /dev/null` \
-lstdc++ -lpcre -lm -lgc -lpthread -levent -lrt