-
-
Notifications
You must be signed in to change notification settings - Fork 191
/
Dockerfile
64 lines (56 loc) · 2.05 KB
/
Dockerfile
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
# Stage 1: build the cross compiler.
FROM ubuntu:20.04 AS bootstrap
RUN \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
cmake \
curl \
ninja-build \
python3 \
python3-distutils \
tar \
xz-utils
WORKDIR /build
RUN curl --location https://github.com/mingw-w64/mingw-w64/archive/a3f6d363d534e9d5563a0b7c677889101e6bbd42.tar.gz | tar xz && \
mv mingw-w64-a3f6d363d534e9d5563a0b7c677889101e6bbd42 mingw-w64
RUN curl --location https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-14.0.0.tar.gz | tar xz && \
mv llvm-project-llvmorg-14.0.0 llvm-project
ENV TOOLCHAIN_ARCHS="armv7 aarch64"
COPY llvm-mingw/build-llvm.sh ./
RUN ./build-llvm.sh /opt/llvm-mingw
COPY llvm-mingw/install-wrappers.sh ./
COPY llvm-mingw/wrappers/* ./wrappers/
RUN ./install-wrappers.sh /opt/llvm-mingw
COPY llvm-mingw/build-mingw-w64.sh ./
RUN ./build-mingw-w64.sh /opt/llvm-mingw
COPY llvm-mingw/build-compiler-rt.sh ./
RUN ./build-compiler-rt.sh /opt/llvm-mingw
COPY llvm-mingw/build-libcxx.sh ./
RUN ./build-libcxx.sh /opt/llvm-mingw
COPY llvm-mingw/strip-llvm.sh ./
RUN ./strip-llvm.sh /opt/llvm-mingw
# Stage 2: create a minimal image for cross-compilation.
FROM ubuntu:20.04
RUN \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
gnupg \
software-properties-common && \
curl 'https://deb.nodesource.com/gpgkey/nodesource.gpg.key' | apt-key add - && \
apt-add-repository 'deb https://deb.nodesource.com/node_14.x focal main' && \
sed -n -e 's/^deb /deb-src /p' /etc/apt/sources.list >/etc/apt/sources.list.d/quick-lint-js-sources.list
RUN \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
cmake \
g++ \
git \
ninja-build \
nodejs
COPY --from=bootstrap /opt/llvm-mingw /opt/llvm-mingw
ENV PATH=/opt/llvm-mingw/bin:$PATH