-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (24 loc) · 1021 Bytes
/
Dockerfile
File metadata and controls
32 lines (24 loc) · 1021 Bytes
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
FROM debian:bookworm-slim AS build
ARG ZIG_VERSION=0.15.2
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates curl xz-utils nodejs npm \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /src
COPY . .
RUN curl -L "https://ziglang.org/download/${ZIG_VERSION}/zig-x86_64-linux-${ZIG_VERSION}.tar.xz" -o /tmp/zig.tar.xz \
&& mkdir -p /opt/zig \
&& tar -xf /tmp/zig.tar.xz -C /opt/zig --strip-components=1 \
&& /opt/zig/zig build -Doptimize=ReleaseFast \
&& /opt/zig/zig build wasm \
&& cd playground \
&& npm ci \
&& npm run build
FROM debian:bookworm-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /src/zig-out/bin/zwgsl /usr/local/bin/zwgsl
COPY --from=build /src/zig-out/bin/zwgsl-lsp /usr/local/bin/zwgsl-lsp
COPY --from=build /src/zig-out/include/zwgsl.h /usr/local/include/zwgsl.h
COPY --from=build /src/zig-out/lib/ /usr/local/lib/
ENTRYPOINT ["zwgsl"]