forked from oven-sh/bun
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.musl
26 lines (21 loc) · 987 Bytes
/
Dockerfile.musl
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
FROM alpine:3.15 as base
RUN apk update
RUN apk add --no-cache cmake make clang clang-static clang-dev llvm12-dev llvm12-static musl-dev git lld libgcc gcc g++ libstdc++ build-base lld-dev lld-static llvm12-libs libc-dev xz zlib zlib-dev libxml2 libxml2-dev
ENV CXX=clang++
ENV CC=clang
ENV LDFLAGS='-L/usr/include -L/usr/include/llvm12'
ENV CXXFLAGS="-I/usr/include -I/usr/include/llvm12"
ENV PATH="/usr/bin:/usr/local/bin:/zig/bin:$PATH"
FROM base as zig
# Compile zig
RUN --mount=type=tmpfs,target=/zig-build mkdir /zig; \
cd /zig-build && \
mkdir -p /zig-build; \
git clone -b jarred/zig-sloppy-with-small-structs --single-branch --depth=1 https://github.com/oven-sh/zig.git .; \
cd /zig-build; \
cmake . -DZIG_STATIC_LLVM=ON -DLLVM_INCLUDE_DIRS=$LLVM_INCLUDE_DIRS -DCMAKE_BUILD_TYPE=Release && \
make -j$(nproc) && make install && \
rm -rf .git && \
cd /zig-build && \
cp -r /zig-build/bin /zig/bin && \
cp -r /zig-build/lib /zig/lib