forked from nulang-org/nulang
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.compiler
More file actions
35 lines (26 loc) · 1.22 KB
/
Copy pathDockerfile.compiler
File metadata and controls
35 lines (26 loc) · 1.22 KB
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
# Nulang compiler image - minimal binary with the WASM backend only.
#
# Used by nulang-cloud's nlc-deploy image as the NULANG_BIN compiler for the
# direct-upload Nulang source path (`compile_nulang` invokes
# `nulang --backend wasm --out <out> <input.nula>`). Built without the
# python/sqlite/lsp/ai-runtime features so the image stays small and has no
# Python runtime dependency.
#
# Build: docker build -f Dockerfile.compiler -t nulang .
FROM rust:1.95-slim-bookworm AS builder
RUN apt-get update && apt-get install -y --no-install-recommends \
pkg-config libssl-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
COPY . .
RUN CARGO_TARGET_DIR=/build/target cargo build --release --no-default-features --features wasm-backend --bin nulang
# Smoke test: the compiler can emit WASM.
RUN printf 'perform IO.print("x")\n' > /tmp/smoke.nula \
&& /build/target/release/nulang --backend wasm --out /tmp/smoke.wasm /tmp/smoke.nula \
&& echo "compiler smoke ok"
# ---- Runtime Stage ----
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=builder /build/target/release/nulang /usr/local/bin/nulang
ENTRYPOINT ["nulang"]