Publish
Build and publish your agent image in agentregistry by using the arctl agent build and arctl agent publish commands.
About publishing agents
Agentregistry serves as a catalog for your AI artifacts, including agents, skills, and MCP servers. To control which images you want to make available to your teams, you can use the publishing capability in agentregistry. If an image is published, a reference to its container image location is stored in agentregistry. This allows teams to quickly discover approved agents and deploy them to their environments.
Before you can publish an image reference, you must first build the image. Agentregistry provides the following options for building your agent images:
- Build the image locally. This option assumes that you want to build the agent image on your local machine only, such as for local test setups. The image is not pushed to your container registry. While you can still create a catalog entry for the agent image in agentregistry by using the
arctl agent publishcommand, you cannot deploy the image to a Kubernetes cluster, unless you manually load the image to your cluster. - Build and push: This process allows you to build the agent image on your local machine and push it to your container registry. Note that this option requires you to be logged into the container registry that you want to use and that the
agent.yamlfile includes the correct container registry and image tag details.
For testing purposes, the instructions in this guide assume that you do not want to use agentregistry to push the image to your container registry.
Before you begin
- Follow the Get started guide to set up agentregistry and start the agentregistry daemon.
- Create an agent.
Publish the agent image
-
Build the agent image on your local machine. The following command builds the image with the Dockerfile that is included in your
myagentscaffold and tags it with the container registry and version information that is provided in theagent.yamlfile. If you followed the instructions in this guide,ghcr.io/myagent:latestis used.arctl agent build myagentExample output:
[+] Building 48.4s (12/12) FINISHED docker:desktop-linux => [internal] load build definition from Dockerfile 0.1s => => transferring dockerfile: 384B 0.0s => [internal] load metadata for ghcr.io/kagent-dev/kagent/kagent-adk:0.7.4 ... ✅ Successfully built Docker image: ghcr.io/myagent:latestTo also use agentregistry to push the image to your container registry, include the--pushoption. You can also set the platform, for which you want to build the image, such aslinux/amd64by using the--platformoption. For more information, see the arctl agent build command. Make sure that you are logged in to your container registry before you run the command. -
Verify that the image is built.
docker images | grep ghcr.io/myagentExample output:
ghcr.io/myagent latest b530ddc3c8d8 11 minutes ago 2.9GB -
Publish the agent in agentregistry. The following command adds a reference to your image location in agentregistry.
arctl agent publish myagentExample output:
Agent 'myagent' version latest published successfully -
List the agent image references in agentregistry. Verify that you see an entry for the
myagentagent image that you just published.arctl agent listExample output:
NAME VERSION FRAMEWORK LANGUAGE PROVIDER MODEL DEPLOYED PUBLISHED myagent latest adk python gemini gemini-2.0-flash False True -
Optional: Open the agentregistry UI and go to the Agents view. Verify that you can see your agent image reference.
Next
Now that you published the agent image, you can deploy the agent to your environment.
Cleanup
To unpublish an agent image from agentregistry, use the arctl agent unpublish command.
arctl agent unpublish myagent