Skip to content

Submit container image build

POST/v5/builds

Create a container image build record.

This multipart request accepts exactly one image source. Provide context_archive to stream a tar.gz build context to the configured cloud build provider, or provide image_url to register an existing tagged image as an immediately successful build without invoking the provider. build_args and platform apply only to archive builds.

Exactly one of agent_name or agent_id must identify the target agent. agent_name creates a new build-only agent and must be unused. agent_id targets an existing agent. Archive builds normally return in a queued or running state; prebuilt images can immediately be passed to Cloud Deploy using the returned build ID. Archives must be non-empty and no larger than 500 MB.

Body ParametersForm DataExpand Collapse
image_name: string

Name for the built image

agent_id: optional string

ID of the existing agent this build targets

agent_name: optional string

Name of the brand-new agent to create from this build

build_args: optional string

JSON string of build arguments

context_archive: optional file

tar.gz archive containing the build context (Dockerfile and any files needed for the build)

image_tag: optional string

Tag for the built image

image_url: optional string

Existing tagged image to register instead of running a build

platform: optional "linux/amd64" or "linux/arm64" or "linux/arm/v7"

Target platform for the Docker build. Defaults to the build host’s native architecture when not specified.

One of the following:
"linux/amd64"
"linux/arm64"
"linux/arm/v7"
source_commit: optional string

Git commit the build context was at.

maxLength64
source_dirty: optional boolean

Whether the work tree had uncommitted changes at build time.

source_ref: optional string

Git branch or tag for source_commit.

maxLength4096
source_repo: optional string

Normalized git remote the build context came from.

maxLength2048
source_subpath: optional string

Build-context path relative to the repo root.

maxLength4096
working_tree_hash: optional string

Deterministic SHA-256 content hash of the build inputs.

maxLength64
ReturnsExpand Collapse
AgentexCloudBuild object { id, account_id, agent_name, 17 more }
id: string

The unique identifier of the entity.

account_id: string

The ID of the account that owns the given entity.

agent_name: string

The name of the agent that this build belongs to

build_status: "queued" or "running" or "success" or 8 more

The current build lifecycle status

One of the following:
"queued"
"running"
"success"
"failed"
"cancelling"
"cancelled"
"deleting"
"delete_failed"
"timed_out"
"error"
"unknown"
cloud_provider_build_id: string

The unique identifier of the build from the cloud provider, or an internal UUID when an existing image is copied without a provider build.

created_at: string

The date and time when the entity was created in ISO format.

formatdate-time
created_by: Identity { id, type, object }

The identity that created the entity.

id: string
type: "user" or "service_account"
One of the following:
"user"
"service_account"
object: optional "identity"
image_name: string

The name of the container image to build.

image_tag: string

The tag for the container image.

source_commit: string

Git commit the build context was at, when a git work tree.

source_dirty: boolean

Whether the work tree had uncommitted changes at build time (null outside git).

source_ref: string

Git branch or tag for source_commit, when resolvable.

source_repo: string

Normalized git remote the build context came from (host/path, no credentials).

source_subpath: string

Build-context path relative to the repo root (which agent, in a monorepo).

working_tree_hash: string

Deterministic SHA-256 content hash of the build inputs (not the tarball).

agent_id: optional string

The UUID of the agent that this build belongs to

build_end_time: optional string

When the cloud provider finished the build

formatdate-time
build_start_time: optional string

When the cloud provider started the build

formatdate-time
image_url: optional string

The URL of the container image. This is not guaranteed to be present until the build is complete.

object: optional "agentex_cloud_build"

Submit container image build

curl https://api.egp.scale.com/v5/builds \
    -H 'Content-Type: multipart/form-data' \
    -H "x-api-key: $SGP_API_KEY" \
    -F image_name=image_name
{
  "id": "id",
  "account_id": "account_id",
  "agent_name": "agent_name",
  "build_status": "queued",
  "cloud_provider_build_id": "cloud_provider_build_id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by": {
    "id": "id",
    "type": "user",
    "object": "identity"
  },
  "image_name": "image_name",
  "image_tag": "image_tag",
  "source_commit": "source_commit",
  "source_dirty": true,
  "source_ref": "source_ref",
  "source_repo": "source_repo",
  "source_subpath": "source_subpath",
  "working_tree_hash": "working_tree_hash",
  "agent_id": "agent_id",
  "build_end_time": "2019-12-27T18:11:19.117Z",
  "build_start_time": "2019-12-27T18:11:19.117Z",
  "image_url": "image_url",
  "object": "agentex_cloud_build"
}
Returns Examples
{
  "id": "id",
  "account_id": "account_id",
  "agent_name": "agent_name",
  "build_status": "queued",
  "cloud_provider_build_id": "cloud_provider_build_id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by": {
    "id": "id",
    "type": "user",
    "object": "identity"
  },
  "image_name": "image_name",
  "image_tag": "image_tag",
  "source_commit": "source_commit",
  "source_dirty": true,
  "source_ref": "source_ref",
  "source_repo": "source_repo",
  "source_subpath": "source_subpath",
  "working_tree_hash": "working_tree_hash",
  "agent_id": "agent_id",
  "build_end_time": "2019-12-27T18:11:19.117Z",
  "build_start_time": "2019-12-27T18:11:19.117Z",
  "image_url": "image_url",
  "object": "agentex_cloud_build"
}