-
Notifications
You must be signed in to change notification settings - Fork 157
Expand file tree
/
Copy pathDockerfile.agentcore
More file actions
39 lines (32 loc) · 1.47 KB
/
Copy pathDockerfile.agentcore
File metadata and controls
39 lines (32 loc) · 1.47 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
36
37
38
39
# Dockerfile.agentcore — OAB + native AgentCore bridge (no bundled coding CLI).
# The coding agent (Kiro, Claude, Codex, etc.) runs remotely in AgentCore Runtime.
# Result: ~20MB image — single Rust binary, no Python/pip needed.
# --- Build stage ---
FROM rust:1-bookworm AS builder
WORKDIR /build
COPY Cargo.toml Cargo.lock ./
COPY crates/openab-core/Cargo.toml crates/openab-core/Cargo.toml
COPY crates/openab-gateway/Cargo.toml crates/openab-gateway/Cargo.toml
RUN mkdir -p src crates/openab-core/src crates/openab-gateway/src \
&& echo 'fn main() {}' > src/main.rs \
&& echo '' > crates/openab-core/src/lib.rs \
&& echo '' > crates/openab-gateway/src/lib.rs \
&& cargo build --release --features agentcore \
&& rm -rf src crates/openab-core/src crates/openab-gateway/src
COPY crates/ crates/
COPY src/ src/
RUN touch src/main.rs crates/openab-core/src/lib.rs crates/openab-gateway/src/lib.rs && cargo build --release --features agentcore
# --- Runtime stage ---
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates tini \
&& rm -rf /var/lib/apt/lists/*
RUN useradd -m -s /bin/bash -u 1000 agent
ENV HOME=/home/agent
WORKDIR /home/agent
COPY --from=builder --chown=agent:agent /build/target/release/openab /usr/local/bin/openab
USER agent
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD pgrep -x openab || exit 1
ENTRYPOINT ["tini", "--"]
CMD ["openab", "run", "-c", "/etc/openab/config.toml"]