Release 0.1.0: MIT license, changelog, multi-arch Docker image without CLI builds
- LICENSE (MIT), CHANGELOG for 0.1.0, README overhaul - docker-compose.release.yml pulling the registry image - Dockerfile cross-compiles the server with cargo-zigbuild for amd64 and arm64; the terminal client is no longer built into the image - Server, install script and settings point to a source install of the terminal client when no prebuilt binaries are available (/info: cli_builds) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d14c609576
commit
ed9942829a
15 files changed
+384
-109
No files matched your search
+27
-26
@@ -1,16 +1,35 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
# Multi-arch: the web UI and the server are built once on the build
|
||||
# machine (cross-compiled with cargo-zigbuild); only the runtime stage runs
|
||||
# per target platform.
|
||||
|
||||
# --- web UI (PWA) -------------------------------------------------------------
|
||||
FROM node:22-alpine AS web
|
||||
FROM --platform=$BUILDPLATFORM node:22-alpine AS web
|
||||
WORKDIR /web
|
||||
COPY web/package.json web/package-lock.json ./
|
||||
RUN npm ci --no-audit --no-fund
|
||||
COPY web/ ./
|
||||
RUN npm run build
|
||||
|
||||
# --- server -------------------------------------------------------------------
|
||||
FROM rust:1-bookworm AS server
|
||||
# --- Rust toolchain with zig for cross-compiling --------------------------------
|
||||
FROM --platform=$BUILDPLATFORM rust:1-bookworm AS toolchain
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends cmake xz-utils && rm -rf /var/lib/apt/lists/*
|
||||
ARG ZIG_VERSION=0.17.1
|
||||
RUN curl -fsSL https://ziglang.org/download/${ZIG_VERSION}/zig-$(uname -m)-linux-${ZIG_VERSION}.tar.xz | tar -xJ -C /opt \
|
||||
&& ln -s /opt/zig-*/zig /usr/local/bin/zig \
|
||||
&& cargo install --locked cargo-zigbuild \
|
||||
&& rustup target add x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu
|
||||
WORKDIR /src
|
||||
|
||||
# --- server (for the target platform, glibc of Debian bookworm) ----------------
|
||||
FROM toolchain AS server
|
||||
ARG TARGETARCH
|
||||
RUN case "$TARGETARCH" in \
|
||||
amd64) echo x86_64-unknown-linux-gnu ;; \
|
||||
arm64) echo aarch64-unknown-linux-gnu ;; \
|
||||
*) echo "unsupported architecture $TARGETARCH" >&2; exit 1 ;; \
|
||||
esac > /target
|
||||
COPY config.example.toml ./
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
COPY core/Cargo.toml ./core/
|
||||
@@ -19,33 +38,16 @@ COPY cli/Cargo.toml ./cli/
|
||||
# Cache dependencies separately from the sources (stub crates first).
|
||||
RUN mkdir -p core/src server/src cli/src \
|
||||
&& echo '' > core/src/lib.rs && echo 'fn main(){}' > server/src/main.rs && echo 'fn main(){}' > cli/src/main.rs \
|
||||
&& cargo build --release -p codecraft && rm -rf core/src server/src cli/src
|
||||
&& cargo zigbuild --release -p codecraft --target "$(cat /target).2.36" && rm -rf core/src server/src cli/src
|
||||
COPY core/src ./core/src
|
||||
COPY server/src ./server/src
|
||||
COPY server/resources-cli ./server/resources-cli
|
||||
COPY cli/src ./cli/src
|
||||
ARG GIT_COMMIT=""
|
||||
ENV CODECRAFT_COMMIT=${GIT_COMMIT}
|
||||
RUN touch core/src/lib.rs server/src/main.rs && cargo build --release -p codecraft
|
||||
|
||||
# --- terminal client (static Linux binaries for x86_64 and aarch64) -----------
|
||||
FROM rust:1-bookworm AS cli
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends cmake xz-utils && rm -rf /var/lib/apt/lists/*
|
||||
ARG ZIG_VERSION=0.17.1
|
||||
RUN curl -fsSL https://ziglang.org/download/${ZIG_VERSION}/zig-$(uname -m)-linux-${ZIG_VERSION}.tar.xz | tar -xJ -C /opt \
|
||||
&& ln -s /opt/zig-*/zig /usr/local/bin/zig \
|
||||
&& cargo install --locked cargo-zigbuild \
|
||||
&& rustup target add x86_64-unknown-linux-musl aarch64-unknown-linux-musl
|
||||
WORKDIR /src
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
COPY core ./core
|
||||
COPY server/Cargo.toml ./server/
|
||||
COPY server/resources ./server/resources
|
||||
COPY cli ./cli
|
||||
RUN mkdir -p server/src && echo 'fn main(){}' > server/src/main.rs \
|
||||
&& cargo zigbuild --release -p codecraft-cli --target x86_64-unknown-linux-musl --target aarch64-unknown-linux-musl \
|
||||
&& mkdir -p /out && cp target/x86_64-unknown-linux-musl/release/codecraft /out/codecraft-linux-x86_64 \
|
||||
&& cp target/aarch64-unknown-linux-musl/release/codecraft /out/codecraft-linux-aarch64
|
||||
RUN touch core/src/lib.rs server/src/main.rs \
|
||||
&& cargo zigbuild --release -p codecraft --target "$(cat /target).2.36" \
|
||||
&& cp "target/$(cat /target)/release/codecraft" /codecraft
|
||||
|
||||
# --- runtime ------------------------------------------------------------------
|
||||
# Node is included so agents can work on JS projects and run npx-based MCP servers.
|
||||
@@ -62,9 +64,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
# Language servers for diagnostics after edits (rust-analyzer/gopls/clangd can be
|
||||
# installed by agents: rustup component add rust-analyzer, go install …).
|
||||
RUN npm install -g typescript@5 typescript-language-server pyright && npm cache clean --force
|
||||
COPY --from=server /src/target/release/codecraft /usr/local/bin/codecraft
|
||||
COPY --from=server /codecraft /usr/local/bin/codecraft
|
||||
COPY --from=web /web/dist /app/web
|
||||
COPY --from=cli /out /app/cli
|
||||
COPY server/ghidra /app/ghidra
|
||||
COPY server/resources /app/resources
|
||||
# The agent's home lives on the data volume: tools it installs in user space
|
||||
|
||||
Reference in new issue
Block a user