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
# Multi-stage build for Windjammer
FROM rust:1.75 as builder
WORKDIR /app
# Copy dependency files first for better caching
COPY Cargo.toml Cargo.lock ./
# Create a dummy main.rs to build dependencies
RUN mkdir src && \
echo "fn main() {}" > src/main.rs && \
cargo build --release && \
rm -rf src
# Copy the actual source code
COPY src ./src
COPY std ./std
COPY examples ./examples
# Build the actual binary
RUN cargo build --release
# Runtime stage - use slim Debian image
FROM debian:bookworm-slim
# Install runtime dependencies
RUN apt-get update && \
apt-get install -y \
ca-certificates \
libssl3 \
&& \
rm -rf /var/lib/apt/lists/*
# Copy the binary from builder
COPY --from=builder /app/target/release/windjammer /usr/local/bin/windjammer
# Copy the standard library
COPY --from=builder /app/std /usr/local/lib/windjammer/std
# Set environment variable for stdlib location
ENV WINDJAMMER_STDLIB=/usr/local/lib/windjammer/std
# Create workspace directory
WORKDIR /workspace
# Default command
ENTRYPOINT ["windjammer"]
CMD ["--help"]
# Metadata
LABEL org.opencontainers.image.title="Windjammer"
LABEL org.opencontainers.image.description="A simple language that transpiles to Rust"
LABEL org.opencontainers.image.url="https://github.com/jeffreyfriedman/windjammer"
LABEL org.opencontainers.image.source="https://github.com/jeffreyfriedman/windjammer"
LABEL org.opencontainers.image.licenses="MIT OR Apache-2.0"