Skip to content

Conversation

vvoland
Copy link
Collaborator

@vvoland vvoland commented Sep 5, 2025

No description provided.

@vvoland vvoland self-assigned this Sep 5, 2025
@vvoland vvoland marked this pull request as ready for review September 8, 2025 09:42
docker-bake.hcl Outdated
# Returns the list of supported platforms for static packages for a given package.
function "staticPkgPlatforms" {
params = [pkg]
result = pkg == "cagent" ? [] : pkgPlatforms(pkg)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the Dockerfile: https://github.com/docker/cagent/blob/ab6f7b276b29434623daf733a3d0b524d2d6601d/Dockerfile

I think we can make "static" builds, similar to what has be done for credential helpers:

# static
FROM --platform=$BUILDPLATFORM ${DISTRO_IMAGE} AS builder-static-nosdk
COPY --from=xx / /
ARG DEBIAN_FRONTEND
RUN apt-get update && apt-get install -y --no-install-recommends bash ca-certificates file git zip tar \
dpkg-dev clang make pkg-config
ENV GOPROXY="https://proxy.golang.org|direct"
ENV GOPATH="/go"
ENV PATH="$PATH:/usr/local/go/bin:$GOPATH/bin"
ENV GOTOOLCHAIN="local"
ENV GO111MODULE="on"
ENV CGO_ENABLED="1"
ARG PKG_NAME
ARG PKG_REF
ARG NIGHTLY_BUILD
WORKDIR /build
ARG TARGETPLATFORM
RUN xx-apt-get install -y gcc libsecret-1-dev
RUN --mount=type=bind,source=scripts/pkg-static-build.sh,target=/usr/local/bin/pkg-static-build \
--mount=type=bind,from=scripts,source=gen-ver.sh,target=/usr/local/bin/gen-ver \
--mount=type=bind,from=scripts,source=fix-cc.sh,target=/usr/local/bin/fix-cc \
--mount=type=bind,from=src,source=/src,target=/usr/local/src/credential-helpers \
--mount=type=bind,from=gocross,source=/usr/local/go,target=/usr/local/go,rw \
OUTDIR=/out BUILDDIR=/build SRCDIR=/usr/local/src/credential-helpers pkg-static-build
FROM builder-static-nosdk AS builder-static-linux
FROM builder-static-nosdk AS builder-static-windows
FROM --platform=$BUILDPLATFORM ${DISTRO_IMAGE} AS builder-static-darwin
COPY --from=xx / /
ARG DEBIAN_FRONTEND
RUN apt-get update && apt-get install -y --no-install-recommends bash ca-certificates file git zip tar \
dpkg-dev clang make pkg-config
ENV GOPROXY="https://proxy.golang.org|direct"
ENV GOPATH="/go"
ENV PATH="$PATH:/usr/local/go/bin:$GOPATH/bin"
ENV GOTOOLCHAIN="local"
ENV GO111MODULE="on"
ENV CGO_ENABLED="1"
ARG PKG_NAME
ARG PKG_REF
ARG NIGHTLY_BUILD
WORKDIR /build
ARG TARGETPLATFORM
RUN xx-apt-get install -y gcc libsecret-1-dev
RUN --mount=type=bind,source=scripts/pkg-static-build.sh,target=/usr/local/bin/pkg-static-build \
--mount=type=bind,from=scripts,source=gen-ver.sh,target=/usr/local/bin/gen-ver \
--mount=type=bind,from=scripts,source=fix-cc.sh,target=/usr/local/bin/fix-cc \
--mount=type=bind,from=src,source=/src,target=/usr/local/src/credential-helpers \
--mount=type=bind,from=gocross,source=/usr/local/go,target=/usr/local/go,rw \
--mount=type=bind,from=osxcross,src=/osxsdk,target=/xx-sdk \
OUTDIR=/out BUILDDIR=/build SRCDIR=/usr/local/src/credential-helpers pkg-static-build
FROM builder-static-$TARGETOS AS builder-static

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows static binaries need zig and I haven't figured it out why yet 😅

Also we wouldn't be deploying any static binaries to download.docker.com yet.

My main intent here is to provide cagent packages for Linux distros, so the static binaries are not really needed.

The static binaries are already published in releases https://github.com/docker/cagent/releases, so let's not duplicate that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows static binaries need zig and I haven't figured it out why yet 😅

zig is not needed, you can rely on xx and install gcc cross package (mingw for windows). This should be enough, like we do for credential helpers:

RUN xx-apt-get install -y gcc libsecret-1-dev

See https://github.com/docker/packaging/actions/runs/17588609365/job/49963306654#step:7:1106

The static binaries are already published in releases https://github.com/docker/cagent/releases, so let's not duplicate that.

Not sure why cagent would be an exception where for other pkgs we create static binaries like Buildx that also have assets on GitHub. That would be great to be consistent across packages imo.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We won't be able to use some of the stuff that the cagent pipeline has like: https://github.com/docker/cagent/blob/ab6f7b276b29434623daf733a3d0b524d2d6601d/Dockerfile#L16-L19

There's also some stuff that depends on Docker Desktop, which should probably be omitted for the Linux distro builds: docker/cagent#151

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We won't be able to use some of the stuff that the cagent pipeline has like: https://github.com/docker/cagent/blob/ab6f7b276b29434623daf733a3d0b524d2d6601d/Dockerfile#L16-L19

There's also some stuff that depends on Docker Desktop, which should probably be omitted for the Linux distro builds: docker/cagent#151

Ok I see, then currently linux packages are broken anyway looking at your PR docker/cagent#151? I guess we wait until your PR is merged so linux pkgs are built with this build tag and we could have static packages as well?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docker/cagent#192 should help so we don't need CGO anymore and can do proper static builds

@@ -0,0 +1,52 @@
%global debug_package %{nil}

Name: cagent
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't used cagent; does it use the CLI and/or daemon? We could add a "weak" dependency if it does, e.g. as we did for the model CLI (although that's more clearly a CLI plugin);

Enhances: docker-ce-cli

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a cli plugin afaik cc @dgageot @rumpl

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't used cagent

😱

It's not a cli plugin no

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rumpl does it have any dependency / recommended installation w.r.t. "if you use this, you should also have docker or docker-cli installed? (mostly trying to see if we need to define some relation between the packages, or it it should be considered fully separate from our other offerings)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A recommended would be Docker Desktop actually, for pushing and pulling agents.

Package: cagent
Priority: optional
Architecture: linux-any
Description: TODO
Copy link
Member

@thaJeztah thaJeztah Oct 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rumpl you are a developer at Docker with a deep understanding of of cagent and packaging deb and rpm packages. Write a short description to be used as Description for the official cagent RPM and Deb packages. 🍿

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My agent tells me this:

Short Description (one-line):

Multi-agent AI runtime for orchestrating specialized AI agents with tools and MCP integration

Long Description:

cagent is a powerful multi-agent AI runtime that enables you to create, configure, and
orchestrate specialized AI agents that work together to solve complex problems. Each agent
can be equipped with specific tools, knowledge domains, and capabilities.

Key features:
 * Multi-agent architecture with hierarchical task delegation
 * Declarative YAML-based agent configuration
 * MCP (Model Context Protocol) integration for extensible tooling
 * Support for multiple AI providers (OpenAI, Anthropic, Google Gemini, Docker Model Runner)
 * Built-in reasoning tools (think, todo, memory) for complex problem-solving
 * Docker Hub integration for sharing and distributing agent configurations
 * Event-driven streaming architecture for real-time responses

cagent makes it easy to build agent teams where specialized agents collaborate, each
bringing their own expertise and tools to handle specific aspects of user requests.
Perfect for developers building AI-powered workflows and automation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ship-it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(but don't forget adding a . for empty lines, which I think is required for debs/rpms 😂 )

Description: Docker CLI: the open-source application container engine
Docker is a product for you to build, ship and run any application as a
lightweight container
.
Docker containers are both hardware-agnostic and platform-agnostic. This means
they can run anywhere, from your laptop to the largest cloud compute instance and

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow :D

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@thaJeztah
Copy link
Member

Looks like cagent doesn't compile on Windows;

0.286 + go build -trimpath -ldflags '-w -X '\''github.com/docker/cagent/pkg/version.Version=v0.0.0-20251020133613-26330cc'\'' -X '\''github.com/docker/cagent/pkg/version.Commit=26330cc0e1579ab91fd24a3459986256680d8330'\''' -o /build/cagent/cagent.exe .
0.286 /usr/local/src/cagent /build
28.48 # github.com/docker/cagent/pkg/tools/builtin
28.48 pkg/tools/builtin/shell.go:59:4: unknown field Setpgid in struct literal of type syscall.SysProcAttr
28.48 pkg/tools/builtin/shell.go:260:16: undefined: syscall.Kill

@thaJeztah
Copy link
Member

Looks to be docker/cagent@832479e;

I don't think CI on that repo runs on anything other than Linux? Or is it not meant to be run on mac and windows? 🙈😅

@crazy-max
Copy link
Member

Yes opened docker/cagent#562 and seems there is an on-going fix docker/cagent#564

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants