Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ jobs:
with:
persist-credentials: false
- name: Build controller image
run: make docker
run: make docker BUILD_PROFILE=debug
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,20 @@ RUN --mount=type=cache,id=agentdesktop-pnpm,target=/pnpm/store \

FROM docker.io/library/rust:1.97.1-trixie AS builder
ARG TARGETARCH
ARG BUILD_PROFILE=release
WORKDIR /app
COPY Cargo.toml Cargo.lock rust-toolchain.toml ./
COPY crates ./crates
COPY --from=ui /app/frontend/controller/dist frontend/controller/dist
RUN --mount=type=cache,id=agentdesktop-target-${TARGETARCH},target=/app/target \
--mount=type=cache,id=agentdesktop-cargo-registry,target=/usr/local/cargo/registry \
--mount=type=cache,id=agentdesktop-cargo-git,target=/usr/local/cargo/git \
cargo build --locked --release --package agentdesktop-controller && \
cp target/release/agentdesktop-controller /agentdesktop-controller
case "${BUILD_PROFILE}" in \
release) cargo build --locked --release --package agentdesktop-controller ;; \
debug) cargo build --locked --package agentdesktop-controller ;; \
*) echo "unsupported BUILD_PROFILE: ${BUILD_PROFILE}" >&2; exit 1 ;; \
esac && \
cp "target/${BUILD_PROFILE}/agentdesktop-controller" /agentdesktop-controller

FROM cgr.dev/chainguard/glibc-dynamic:latest
COPY --from=builder /agentdesktop-controller /agentdesktop-controller
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
IMAGE ?= agentdesktop-controller:dev
BUILD_PROFILE ?= release

.PHONY: build install test check lint frontend frontend-check desktop desktop-check format gen generate-schema docker clean

Expand Down Expand Up @@ -47,7 +48,7 @@ generate-schema:
cargo xtask schema

docker:
docker build --tag $(IMAGE) .
docker build --build-arg BUILD_PROFILE=$(BUILD_PROFILE) --tag $(IMAGE) .

clean:
cargo clean
Expand Down