Skip to content
Open
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
3 changes: 1 addition & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
pkg/compose/* @docker/compose-maintainers
pkg/model/* @docker/ai-models-infra
pkg/buildx/* @docker/build
pkg/cagent/* @docker/ai-agent-team
pkg/agent/* @docker/ai-agent-team
pkg/containerd/* @docker/engine
pkg/docker-cli/* @docker/engine
pkg/docker-engine/* @docker/engine

5 changes: 2 additions & 3 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ area/pkg/buildx:
- changed-files:
- any-glob-to-any-file: 'pkg/buildx/**'

area/pkg/cagent:
area/pkg/agent:
- changed-files:
- any-glob-to-any-file: 'pkg/cagent/**'
- any-glob-to-any-file: 'pkg/agent/**'

area/pkg/compose:
- changed-files:
Expand All @@ -44,4 +44,3 @@ area/pkg/docker-engine:
area/pkg/model:
- changed-files:
- any-glob-to-any-file: 'pkg/model/**'

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build-cagent
name: build-agent

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -8,27 +8,27 @@ on:
push:
branches:
- 'main'
- 'cagent/[0-9]+.[0-9]+'
- 'agent/[0-9]+.[0-9]+'
paths:
- '.github/workflows/.build.yml'
- '.github/workflows/build-cagent.yml'
- '.github/workflows/build-agent.yml'
- 'hack/scripts/**'
- 'pkg/cagent/**'
- 'pkg/agent/**'
- 'docker-bake.hcl'
pull_request:
branches:
- 'main'
- 'cagent/[0-9]+.[0-9]+'
- 'agent/[0-9]+.[0-9]+'
paths:
- '.github/workflows/.build.yml'
- '.github/workflows/build-cagent.yml'
- '.github/workflows/build-agent.yml'
- 'hack/scripts/**'
- 'pkg/cagent/**'
- 'pkg/agent/**'
- 'docker-bake.hcl'

jobs:
run:
uses: ./.github/workflows/.build.yml
with:
name: cagent
name: agent
secrets: inherit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: release-cagent
name: release-agent

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -42,7 +42,7 @@ jobs:
release:
uses: ./.github/workflows/.build.yml
with:
name: cagent
name: agent
release: ${{ inputs.release }}
distros: ${{ inputs.distros }}
envs: |
Expand Down
14 changes: 7 additions & 7 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ variable "PKGS" {
"docker-cli",
"docker-engine",
"model",
"cagent"
"agent"
]
}

Expand Down Expand Up @@ -574,12 +574,12 @@ target "_pkg-model" {
}
}

target "_pkg-cagent" {
target "_pkg-agent" {
args = {
PKG_NAME = PKG_NAME != null && PKG_NAME != "" ? PKG_NAME : "cagent"
PKG_REPO = PKG_REPO != null && PKG_REPO != "" ? PKG_REPO : "https://github.com/docker/cagent.git"
PKG_NAME = PKG_NAME != null && PKG_NAME != "" ? PKG_NAME : "docker-agent-plugin"
PKG_REPO = PKG_REPO != null && PKG_REPO != "" ? PKG_REPO : "https://github.com/docker/docker-agent.git"
PKG_REF = PKG_REF != null && PKG_REF != "" ? PKG_REF : "main"
GO_VERSION = GO_VERSION != null && GO_VERSION != "" ? GO_VERSION : "1.26.0" # https://github.com/docker/cagent/blob/main/Dockerfile
GO_VERSION = GO_VERSION != null && GO_VERSION != "" ? GO_VERSION : "1.26.0" # https://github.com/docker/docker-agent/blob/main/Dockerfile
GO_IMAGE_VARIANT = GO_IMAGE_VARIANT != null && GO_IMAGE_VARIANT != "" ? GO_IMAGE_VARIANT : "bookworm"
PKG_DEB_EPOCH = PKG_DEB_EPOCH != null && PKG_DEB_EPOCH != "" ? PKG_DEB_EPOCH : ""
PKG_REMOTE_DOCKERFILE = "Dockerfile"
Expand All @@ -605,8 +605,8 @@ function "pkgPlatforms" {
docker-engine = ["linux/amd64", "linux/arm/v6", "linux/arm/v7", "linux/arm64", "linux/ppc64le", "linux/s390x", "windows/amd64", "windows/arm64"]
# https://github.com/docker/model-runner/blob/039f7a31c0365f9161c9b9b6bb3888161d16e388/cmd/cli/Makefile#L39-L43
model = ["darwin/amd64", "darwin/arm64", "linux/amd64", "linux/arm64", "linux/arm/v7", "windows/amd64", "windows/arm64"]
# https://github.com/docker/cagent/blob/1a83a28df2b0769e8cb14d54ac409bdbb98e254c/Taskfile.yml#L66
cagent = ["darwin/amd64", "linux/arm/v7", "darwin/arm64", "linux/amd64", "linux/arm64", "windows/amd64", "windows/arm64"]
# https://github.com/docker/docker-agent/blob/5b9feaabe743a5ad577f2247ed55d5dcb2678e8b/Taskfile.yml#L79
agent = ["darwin/amd64", "darwin/arm64", "linux/amd64", "linux/arm64", "windows/amd64", "windows/arm64"]
}, pkg, [])
}

Expand Down
24 changes: 12 additions & 12 deletions pkg/cagent/Dockerfile → pkg/agent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ ARG DISTRO_ID="12"
ARG DISTRO_SUITE="bookworm"
ARG DISTRO_IMAGE="debian:bookworm"

ARG PKG_NAME="cagent"
ARG PKG_REPO="https://github.com/docker/cagent.git"
ARG PKG_REF="master"
ARG PKG_NAME="docker-agent-plugin"
ARG PKG_REPO="https://github.com/docker/docker-agent.git"
ARG PKG_REF="main"

ARG GO_IMAGE="golang"
ARG GO_VERSION="1.26.0"
Expand Down Expand Up @@ -59,8 +59,8 @@ ARG PKG_REF
RUN git fetch origin "${PKG_REF}" +refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/tags/* && git checkout -q FETCH_HEAD

FROM src-base AS src-tgz
RUN --mount=from=src,source=/src,target=/cagent \
mkdir /out && tar -C / -zcf /out/cagent.tgz --exclude .git cagent
RUN --mount=from=src,source=/src,target=/agent \
mkdir /out && tar -C / -zcf /out/agent.tgz --exclude .git agent

# metadata
FROM src-base AS metadata-builder
Expand Down Expand Up @@ -115,9 +115,9 @@ RUN --mount=type=bind,source=scripts/pkg-deb-build.sh,target=/usr/local/bin/pkg-
--mount=type=bind,from=scripts,source=gen-ver.sh,target=/usr/local/bin/gen-ver \
--mount=type=bind,from=scripts,source=gen-deb-changelog.sh,target=/usr/local/bin/gen-deb-changelog \
--mount=type=bind,from=scripts,source=fix-cc.sh,target=/usr/local/bin/fix-cc \
--mount=type=bind,from=src,source=/src,target=/root/package/cagent,rw \
--mount=type=bind,from=src,source=/src,target=/root/package/agent,rw \
--mount=type=bind,from=go,source=/usr/local/go,target=/usr/local/go \
OUTDIR=/out SRCDIR=./cagent pkg-deb-build
OUTDIR=/out SRCDIR=./agent pkg-deb-build

# rpm
FROM ${DISTRO_IMAGE} AS builder-rpm
Expand Down Expand Up @@ -151,10 +151,10 @@ ARG SOURCE_DATE_EPOCH
RUN --mount=type=bind,source=scripts/pkg-rpm-build.sh,target=/usr/local/bin/pkg-rpm-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-tgz,source=/out/cagent.tgz,target=/root/rpmbuild/SOURCES/cagent.tgz \
--mount=type=bind,from=src,source=/src,target=/usr/local/src/cagent \
--mount=type=bind,from=src-tgz,source=/out/agent.tgz,target=/root/rpmbuild/SOURCES/agent.tgz \
--mount=type=bind,from=src,source=/src,target=/usr/local/src/agent \
--mount=type=bind,from=go,source=/usr/local/go,target=/usr/local/go \
OUTDIR=/out SRCDIR=/usr/local/src/cagent pkg-rpm-build
OUTDIR=/out SRCDIR=/usr/local/src/agent pkg-rpm-build

# static
FROM --platform=$BUILDPLATFORM ${DISTRO_IMAGE} AS builder-static
Expand Down Expand Up @@ -192,10 +192,10 @@ ARG TARGETPLATFORM
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/cagent \
--mount=type=bind,from=src,source=/src,target=/usr/local/src/agent \
--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/cagent pkg-static-build
OUTDIR=/out BUILDDIR=/build SRCDIR=/usr/local/src/agent pkg-static-build

FROM builder-${DISTRO_TYPE} AS build-pkg
ARG BUILDKIT_SBOM_SCAN_STAGE=true
Expand Down
24 changes: 24 additions & 0 deletions pkg/agent/deb/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Source: docker-agent-plugin
Section: admin
Priority: optional
Maintainer: Docker <support@docker.com>
Homepage: https://www.docker.com
Vcs-Browser: https://github.com/docker/docker-agent
Vcs-Git: git://github.com/docker/docker-agent.git
Standards-Version: 3.9.6
Build-Depends: bash,
gcc,
debhelper-compat (= 12)

Package: docker-agent-plugin
Priority: optional
Architecture: linux-any
Replaces: cagent
Breaks: cagent
Enhances: docker-ce-cli
Description: Docker Agent plugin for the Docker CLI.
.
This plugin provides the 'docker agent' subcommand.
.
The binary can also be run standalone as 'docker-agent'.
Homepage: https://github.com/docker/docker-agent
1 change: 1 addition & 0 deletions pkg/agent/deb/docs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
agent/README.md
11 changes: 6 additions & 5 deletions pkg/cagent/deb/rules → pkg/agent/deb/rules
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ override_dh_builddeb:

override_dh_auto_build:
set -x; \
cd $(CURDIR)/cagent && \
go build -trimpath -ldflags="-w -X 'github.com/docker/cagent/pkg/version.Version=$(VERSION)' -X 'github.com/docker/cagent/pkg/version.Commit=$(REVISION)'" -o /usr/bin/cagent .
install -d /usr/libexec/docker/cli-plugins && \
cd $(CURDIR)/agent && \
go build -trimpath -ldflags="-w -X 'github.com/docker/docker-agent/pkg/version.Version=$(VERSION)' -X 'github.com/docker/docker-agent/pkg/version.Commit=$(REVISION)'" -o /usr/libexec/docker/cli-plugins/docker-agent .

override_dh_auto_test:
ver="$$(/usr/bin/cagent version | grep 'cagent version' | awk '{print $$3}')"; \
test "$$ver" = "$(VERSION)" && echo "PASS: cagent version OK" || (echo "FAIL: cagent version ($$ver) did not match" && exit 1)
ver="$$(/usr/libexec/docker/cli-plugins/docker-agent docker-cli-plugin-metadata | awk '{ gsub(/[",:]/,"")}; $$1 == "Version" { print $$2 }')"; \
test "$$ver" = "$(VERSION)" && echo "PASS: docker-agent version OK" || (echo "FAIL: docker-agent version ($$ver) did not match" && exit 1)

override_dh_strip:
# Go has lots of problems with stripping, so just don't
Expand All @@ -24,7 +25,7 @@ override_dh_dwz:
@# https://packages.ubuntu.com/debhelper

override_dh_auto_install:
install -D -p -m 0755 /usr/bin/cagent debian/cagent/usr/bin/cagent
install -D -p -m 0755 /usr/libexec/docker/cli-plugins/docker-agent debian/docker-agent-plugin/usr/libexec/docker/cli-plugins/docker-agent

override_dh_installinit:
dh_installinit
Expand Down
File renamed without changes.
63 changes: 63 additions & 0 deletions pkg/agent/rpm/docker-agent-plugin.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
%global debug_package %{nil}

Name: docker-agent-plugin
Version: %{_version}
Release: %{_release}%{?dist}
Epoch: 0
Source0: agent.tgz
Summary: Docker Agent plugin for the Docker CLI
Group: Tools/Docker
License: Apache-2.0
URL: https://github.com/docker/docker-agent
Vendor: Docker
Packager: Docker <support@docker.com>

Enhances: docker-ce-cli
Provides: cagent = %{epoch}:%{version}-%{release}
Obsoletes: cagent < %{epoch}:%{version}-%{release}

Copy link
Member Author

Choose a reason for hiding this comment

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

If docker-agent-plugin is built as 0:1.2.3-1, this expands to Provides: cagent = 0:1.2.3-1 and Obsoletes: cagent < 0:1.2.3-1, which tells RPM that this package replaces older cagent installs up to that version.

Copy link
Member

Choose a reason for hiding this comment

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

Do you know if (with a rename) we'd be able to drop the epoch (we never should've had those in any of our packages 🫠)

BuildRequires: bash
BuildRequires: gcc

%description
Docker Agent plugin for the Docker CLI.

This plugin provides the 'docker agent' subcommand.

The binary can also be run standalone as 'docker-agent'.

%prep
%setup -q -c -n src -a 0

%build
pushd ${RPM_BUILD_DIR}/src/agent
mkdir -p bin && \
go build -trimpath -ldflags="-w -X github.com/docker/docker-agent/pkg/version.Version=%{_origversion} -X github.com/docker/docker-agent/pkg/version.Commit=%{_commit}" -o bin/docker-agent .
popd

%check
ver="$(${RPM_BUILD_ROOT}%{_libexecdir}/docker/cli-plugins/docker-agent docker-cli-plugin-metadata | awk '{ gsub(/[",:]/,"")}; $1 == "Version" { print $2 }')"; \
test "$ver" = "%{_origversion}" && echo "PASS: docker-agent version OK" || (echo "FAIL: docker-agent version ($ver) did not match" && exit 1)

%install
pushd ${RPM_BUILD_DIR}/src/agent
install -D -p -m 0755 bin/docker-agent ${RPM_BUILD_ROOT}%{_libexecdir}/docker/cli-plugins/docker-agent
popd
for f in LICENSE README.md; do
install -D -p -m 0644 "${RPM_BUILD_DIR}/src/agent/$f" "docker-agent-plugin-docs/$f"
done

%files
%doc docker-agent-plugin-docs/*
%license docker-agent-plugin-docs/LICENSE
%{_libexecdir}/docker/cli-plugins/docker-agent

%post

%preun

%postun

%changelog
* Wed Mar 17 2026 Docker <support@docker.com> - %{version}-%{release}
- Rename the package to docker-agent-plugin and obsolete cagent
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ set -x

chmod -x debian/control debian/docs
VERSION=${GENVER_VERSION} REVISION=${GENVER_COMMIT} dpkg-buildpackage $PKG_DEB_BUILDFLAGS --host-arch $(xx-info debian-arch) --target-arch $(xx-info debian-arch)
cp /root/cagent* "${pkgoutput}"/
cp /root/docker-agent-plugin* "${pkgoutput}"/
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ mkdir -p ${BUILDDIR}/${PKG_NAME}
(
set -x
pushd ${SRCDIR}
go build -trimpath -ldflags "-w -X 'github.com/docker/cagent/pkg/version.Version=${GENVER_VERSION}' -X 'github.com/docker/cagent/pkg/version.Commit=${GENVER_COMMIT}'" -o "${BUILDDIR}/${PKG_NAME}/cagent${binext}" .
go build -trimpath -ldflags "-w -X 'github.com/docker/docker-agent/pkg/version.Version=${GENVER_VERSION}' -X 'github.com/docker/docker-agent/pkg/version.Commit=${GENVER_COMMIT}'" -o "${BUILDDIR}/${PKG_NAME}/docker-agent${binext}" .
popd
xx-verify "${BUILDDIR}/${PKG_NAME}/cagent${binext}"
xx-verify "${BUILDDIR}/${PKG_NAME}/docker-agent${binext}"
)

pkgoutput="$OUTDIR/static/$(xx-info os)/$(xx-info arch)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ RUN --mount=from=bin,target=/build <<EOT
)
done
set -x
cagent version
/usr/libexec/docker/cli-plugins/docker-agent version
EOT

FROM base AS verify-rpm
Expand Down Expand Up @@ -84,7 +84,7 @@ RUN --mount=from=bin,target=/build <<EOT
)
done
set -x
cagent version
/usr/libexec/docker/cli-plugins/docker-agent version
EOT

FROM base AS verify-static
Expand Down Expand Up @@ -112,7 +112,7 @@ RUN --mount=from=bin,target=/build <<EOT
)
done
set -x
cagent version
docker-agent version
EOT

FROM verify-${DISTRO_TYPE}
33 changes: 0 additions & 33 deletions pkg/cagent/deb/control

This file was deleted.

1 change: 0 additions & 1 deletion pkg/cagent/deb/docs

This file was deleted.

Loading