-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
61 lines (46 loc) · 1.75 KB
/
Dockerfile
File metadata and controls
61 lines (46 loc) · 1.75 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# syntax=docker/dockerfile:1
FROM rust:1.88-slim AS builder
WORKDIR /app
# Install build dependencies
RUN apt-get update && apt-get install -y \
pkg-config \
libssl-dev \
libasound2-dev \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# Clone agent-core at a pinned ref (update SHA when agent-core changes)
# Pinning to a commit busts Docker layer cache and ensures reproducibility
ARG GITHUB_TOKEN
ARG AGENT_CORE_REF=0589102
RUN if [ -n "$GITHUB_TOKEN" ]; then \
git clone https://x-access-token:${GITHUB_TOKEN}@github.com/omnidotdev/agent-core.git /agent-core; \
else \
git clone https://github.com/omnidotdev/agent-core.git /agent-core; \
fi && cd /agent-core && git checkout "$AGENT_CORE_REF"
# Copy manifests first for layer caching
COPY Cargo.toml Cargo.lock ./
# Rewrite the [patch] path to point at the Docker-local clone
RUN sed -i 's|path = "../../../agent-core"|path = "/agent-core"|' Cargo.toml
# Create dummy src to build dependencies
RUN mkdir src && echo "fn main() {}" > src/main.rs && echo "pub fn dummy() {}" > src/lib.rs
RUN cargo build --release || true
RUN rm -rf src target/release/deps/beacon* target/release/.fingerprint/beacon*
# Copy source and personas (needed at compile time for include_str!)
COPY src ./src
COPY personas ./personas
RUN touch src/lib.rs && cargo build --release
# Runtime
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y \
ca-certificates \
libasound2 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/target/release/beacon /usr/local/bin/beacon
# Copy personas (must be in build context)
COPY personas /etc/beacon/personas
ENV RUST_LOG=info
ENV BEACON_PERSONAS_DIR=/etc/beacon/personas
ENV BEACON_DISABLE_VOICE=true
EXPOSE 18789 18790
CMD ["beacon"]