-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile-alpine3.19.template
91 lines (85 loc) · 2.43 KB
/
Dockerfile-alpine3.19.template
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
::HEADER::
FROM alpine:3.19
# ensure local haxe is preferred over distribution haxe
ENV PATH /usr/local/bin:$PATH
# install ca-certificates so that HTTPS works consistently
# the other runtime dependencies are installed later
RUN apk add --no-cache ca-certificates
ENV NEKO_VERSION ::NEKO_VERSION::
ENV HAXE_VERSION ::HAXE_VERSION::
ENV HAXE_STD_PATH /usr/local/share/haxe/std
RUN set -ex \
&& apk add --no-cache --virtual .fetch-deps \
tar \
git \
\
&& wget -O neko.tar.gz "https://github.com/HaxeFoundation/neko/archive/::NEKO_TAG::/neko-::NEKO_VERSION::.tar.gz" \
&& echo "::NEKO_SHA256:: *neko.tar.gz" | sha256sum -c - \
&& mkdir -p /usr/src/neko \
&& tar -xC /usr/src/neko --strip-components=1 -f neko.tar.gz \
&& rm neko.tar.gz \
&& apk add --no-cache --virtual .neko-build-deps \
apache2-dev \
cmake \
gc-dev \
gcc \
::if NEKO_GTK3::gtk+3.0-dev::else::gtk+2.0-dev::end:: \
libc-dev \
linux-headers \
::if NEKO_PCRE2::pcre2-dev::else::pcre-dev::end:: \
mariadb-dev \
mbedtls-dev \
ninja \
sqlite-dev \
&& cd /usr/src/neko \
&& cmake -GNinja -DNEKO_JIT_DISABLE=ON -DRELOCATABLE=OFF -DRUN_LDCONFIG=OFF . \
&& ninja \
&& ninja install \
\
&& git clone --recursive --depth 1 --branch ::HAXE_TAG:: "https://github.com/HaxeFoundation/haxe.git" /usr/src/haxe \
&& cd /usr/src/haxe \
&& mkdir -p $HAXE_STD_PATH \
&& cp -r std/* $HAXE_STD_PATH \
&& apk add --no-cache --virtual .haxe-build-deps \
bash \
::if PCRE2::pcre2-dev::else::pcre-dev::end:: \
zlib-dev \
mbedtls-dev \
make \
opam \
aspcud \
m4 \
unzip \
patch \
pkgconf \
rsync \
musl-dev \
perl-string-shellquote \
perl-ipc-system-simple \
ocaml-compiler-libs \
ocaml-ocamldoc \
&& opam init --compiler=4.11.0 --disable-sandboxing \
&& eval $(opam env) \
::foreach OPAM_PINS::\
&& opam pin add ::lib:: ::version:: --no-action \
::end::\
&& opam install . --deps-only --no-depexts --yes \
&& make \
&& eval $(opam env --revert) \
&& mkdir -p /usr/local/bin \
&& cp haxe haxelib /usr/local/bin \
&& mkdir -p /haxelib \
&& cd / && haxelib setup /haxelib \
\
&& runDeps="$( \
scanelf --needed --nobanner --recursive /usr/local \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u \
| xargs -r apk info --installed \
| sort -u \
)" \
&& apk add --virtual .haxe-rundeps $runDeps \
&& apk del .fetch-deps .neko-build-deps .haxe-build-deps \
&& rm -rf ~/.opam \
&& rm -rf /usr/src/neko /usr/src/haxe
CMD ["haxe"]