Skip to content

Commit 38058e8

Browse files
committed
perf: minimal Docker image - remove all language runtimes from executor
Executor only orchestrates, it does not run tests itself. Removes Python, Node, Go, Rust toolchain, pip packages, npm packages. Runtime is just the stripped binary + ca-certificates + git + curl + libssl3.
1 parent ddd1a24 commit 38058e8

1 file changed

Lines changed: 7 additions & 23 deletions

File tree

Dockerfile

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,20 @@
1-
FROM rust:1.93-bookworm AS builder
1+
# ── Build stage ──
2+
FROM rust:1.93-slim-bookworm AS builder
3+
RUN apt-get update -qq && apt-get install -y -qq --no-install-recommends \
4+
pkg-config libssl-dev && rm -rf /var/lib/apt/lists/*
25
WORKDIR /build
36
COPY Cargo.toml Cargo.lock ./
47
COPY src ./src
5-
RUN cargo build --release
8+
RUN cargo build --release && strip target/release/term-executor
69

10+
# ── Runtime stage ──
711
FROM debian:bookworm-slim
8-
912
RUN apt-get update && apt-get install -y --no-install-recommends \
10-
ca-certificates git curl wget procps \
11-
python3 python3-pip python3-venv \
12-
nodejs npm \
13-
build-essential pkg-config libssl-dev \
13+
ca-certificates git curl libssl3 \
1414
&& rm -rf /var/lib/apt/lists/*
15-
16-
RUN python3 -m pip install --break-system-packages \
17-
pytest pytest-cov pytest-xdist unittest2 nose2 tox
18-
19-
RUN npm install -g tsx jest vitest mocha
20-
21-
RUN curl -fsSL https://go.dev/dl/go1.22.5.linux-amd64.tar.gz | tar -C /usr/local -xz
22-
23-
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
24-
25-
ENV PATH="/usr/local/go/bin:/root/.cargo/bin:${PATH}"
26-
2715
COPY --from=builder /build/target/release/term-executor /usr/local/bin/
28-
2916
RUN mkdir -p /tmp/sessions
30-
3117
EXPOSE 8080
32-
3318
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
3419
CMD curl -f http://localhost:8080/health || exit 1
35-
3620
CMD ["term-executor"]

0 commit comments

Comments
 (0)