Summary
On the preview branch, harness.json validates the dockerfile field (see src/schema/schemas/primitives/harness.ts / src/schema/llm-compacted/agentcore.ts), and agentcore create / agentcore add harness with a template will copy a Dockerfile next to harness.json. However, agentcore deploy does not build or push the Dockerfile, and no error/warning is emitted. The resulting harness is created without any custom container — silently.
This is surprising given the obvious user expectation that setting dockerfile: "Dockerfile" in harness.json would cause the CLI to build/push that image (mirroring the agent Container build path introduced in #783).
Version / Environment
@aws/agentcore@1.0.0-preview.1 (installed globally and verified by building and running HEAD of the preview branch locally)
- macOS 15.3 / Node 20 / Docker available
- Region:
us-east-1
Reproduction
harness.json:
{
"name": "pptagent",
"model": { "provider": "bedrock", "modelId": "us.anthropic.claude-opus-4-5-20251101-v1:0" },
"tools": [
{ "type": "agentcore_browser", "name": "browser" },
{ "type": "agentcore_code_interpreter", "name": "code-interpreter" }
],
"skills": ["/opt/skills/pptx"],
"dockerfile": "Dockerfile",
"sessionStoragePath": "/mnt/data",
"authorizerType": "AWS_IAM"
}
A Dockerfile exists alongside harness.json. Running:
agentcore deploy --yes --verbose
completes successfully, but:
- No Docker build or ECR push step runs.
- The synthesized CFN template (
agentcore/cdk/cdk.out/*.template.json) contains no container image / ECR / asset references for the harness.
- The resulting harness has no custom environment artifact.
Root cause (code pointers on preview)
src/cli/operations/deploy/imperative/deployers/harness-mapper.ts only consumes containerUri when building CreateHarness options:
// Container artifact
if (harnessSpec.containerUri) {
result.environmentArtifact = mapEnvironmentArtifact(harnessSpec.containerUri);
}
The dockerfile field from the validated HarnessSpec is never read by the deployer. src/assets/cdk/bin/cdk.ts does pass hasDockerfile: !!harnessSpec.dockerfile into the CDK stack, but the CDK construct (AgentCoreHarnessRole) only creates an IAM role; there is no DockerImageAsset / CodeBuild step that produces a containerUri for harnesses. As a result, dockerfile is declared-but-unimplemented.
Expected behavior
Either:
- (A) Implement build+push — When
harnessSpec.dockerfile is set and harnessSpec.containerUri is not, build the Dockerfile next to harness.json and push it (via CDK DockerImageAsset or a CodeBuild-backed asset, mirroring the agent Container path), then feed the resulting image URI into mapHarnessSpecToCreateOptions.
- (B) Minimum bug fix — Until (A) ships, fail fast with a clear, actionable error during
agentcore deploy instead of silently ignoring dockerfile.
I'm happy to send a PR for (B) (fail fast + unit test) immediately, and would love guidance on (A) if it's already on the roadmap.
Related
Summary
On the
previewbranch,harness.jsonvalidates thedockerfilefield (seesrc/schema/schemas/primitives/harness.ts/src/schema/llm-compacted/agentcore.ts), andagentcore create/agentcore add harnesswith a template will copy aDockerfilenext toharness.json. However,agentcore deploydoes not build or push the Dockerfile, and no error/warning is emitted. The resulting harness is created without any custom container — silently.This is surprising given the obvious user expectation that setting
dockerfile: "Dockerfile"inharness.jsonwould cause the CLI to build/push that image (mirroring the agent Container build path introduced in #783).Version / Environment
@aws/agentcore@1.0.0-preview.1(installed globally and verified by building and runningHEADof thepreviewbranch locally)us-east-1Reproduction
harness.json:{ "name": "pptagent", "model": { "provider": "bedrock", "modelId": "us.anthropic.claude-opus-4-5-20251101-v1:0" }, "tools": [ { "type": "agentcore_browser", "name": "browser" }, { "type": "agentcore_code_interpreter", "name": "code-interpreter" } ], "skills": ["/opt/skills/pptx"], "dockerfile": "Dockerfile", "sessionStoragePath": "/mnt/data", "authorizerType": "AWS_IAM" }A
Dockerfileexists alongsideharness.json. Running:completes successfully, but:
agentcore/cdk/cdk.out/*.template.json) contains no container image / ECR / asset references for the harness.Root cause (code pointers on
preview)src/cli/operations/deploy/imperative/deployers/harness-mapper.tsonly consumescontainerUriwhen buildingCreateHarnessoptions:The
dockerfilefield from the validatedHarnessSpecis never read by the deployer.src/assets/cdk/bin/cdk.tsdoes passhasDockerfile: !!harnessSpec.dockerfileinto the CDK stack, but the CDK construct (AgentCoreHarnessRole) only creates an IAM role; there is noDockerImageAsset/ CodeBuild step that produces acontainerUrifor harnesses. As a result,dockerfileis declared-but-unimplemented.Expected behavior
Either:
harnessSpec.dockerfileis set andharnessSpec.containerUriis not, build the Dockerfile next toharness.jsonand push it (via CDKDockerImageAssetor a CodeBuild-backed asset, mirroring the agent Container path), then feed the resulting image URI intomapHarnessSpecToCreateOptions.agentcore deployinstead of silently ignoringdockerfile.I'm happy to send a PR for (B) (fail fast + unit test) immediately, and would love guidance on (A) if it's already on the roadmap.
Related