Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.
AdoptionIntegrationRegistry Types

From Amazon ECR

Move container images from Amazon ECR to Harness Artifacts using Docker, skopeo, or crane, with a concept mapping and what to update in pipelines.

Amazon ECR is a fully managed Docker and OCI registry that is tightly integrated with the AWS ecosystem. It does its job well, but it does only one job. If your software delivery needs have grown beyond container images, or your teams are building on more than one cloud, moving to Harness Artifacts gives you multi-format support, cloud-agnostic authentication, and a registry that is part of the same platform as your CI, CD, and security tooling.

This guide maps your ECR concepts to Harness Artifacts equivalents and walks you through two migration approaches.

What's the same, what changes

What stays the same. Docker and OCI images are first-class in Harness Artifacts. Your image names, tags, and multi-architecture manifest lists all migrate without conversion. The pull commands your applications and Kubernetes workloads use change only in the registry hostname.

What changes for your team.

ECR concept
Harness Artifacts equivalent
Notes

Repository (per region, per account)

Registry

One global endpoint (no region routing)

IAM auth + aws ecr get-login-password

PAT or SAT, docker login pkg.harness.io

Token does not expire after 12 hours

ECR URI: <acct>.dkr.ecr.<region>.amazonaws.com/<repo>

pkg.harness.io/<ACCOUNT_ID>/<REGISTRY>/<IMAGE>

No AWS credentials required

Lifecycle policies

Cleanup and retention rules

Basic scanning + Amazon Inspector

Built-in vulnerability scanning

Scanning is part of Artifacts, not a separately licensed product

Pull-through cache (fixed upstream list)

Upstream proxy (any custom source)

You can add any registry as an upstream proxy

No package policy enforcement

Dependency Firewall

OPA-based policies block packages at the upstream proxy

No multi-format support

25+ package formats

Maven, npm, PyPI, NuGet, Go, Helm HTTP, Cargo, and more

What improves.

ECR's pull-through cache works only with a fixed set of approved upstreams: roughly ECR Public, Docker Hub, Quay, registry.k8s.io, GHCR, and a few others. You cannot add a private source or an arbitrary custom registry. Harness upstream proxies accept any reachable registry.

ECR has no equivalent to the Dependency Firewall. Packages pulled through an ECR pull-through cache have no policy gate. In Harness Artifacts, the Dependency Firewall evaluates packages against OPA policies, checking for known vulnerabilities, unwanted licences, or package age thresholds, before they are cached in your registry.

Software Delivery Agent. Once your images are in Harness Artifacts, the Harness Software Delivery Agent can query your registries, artifact versions, and scan results through the Artifacts REST API (the same API your pipelines use). The agent can answer questions like "what is the latest scan-clean version of this image?", surface registries that hold artifacts with open critical CVEs, or evaluate a lifecycle rule in dry-run mode, without leaving your delivery workflow. Go to Using Artifacts with AI agents for the full picture.

Before you begin

  • Have AWS credentials with ecr:GetAuthorizationToken and ecr:BatchGetImage on the source repositories.

  • Create a Harness personal access token (PAT) with push permission on the destination registries. Go to Authentication and identity tokens.

  • Create the destination registries in Harness Artifacts before migrating. Go to Create a registry and select Docker as the type.

  • Have your Harness account ID ready. It appears in the URL when you log in to Harness (app.harness.io).

The Harness CLI migration tool (hc registry migrate) supports JFrog Artifactory and Nexus as source types. Amazon ECR is not a supported source type for the CLI tool. Use the Docker, skopeo, or crane approaches below.

Migration options

Three approaches cover the full range of use cases.

Option A: Gradual cut-over with an upstream proxy. Point a Harness upstream proxy at your ECR instance. Images that do not yet exist in Harness are fetched from ECR on first request and cached. You migrate traffic incrementally by updating pipelines one by one, with no bulk copy required. Best when you want zero downtime and a rollback path.

Option B: Docker pull and push. Works for any environment where Docker is installed. Best for a one-time migration of a small number of images or for testing before a full migration.

Option C: skopeo or crane (bulk copy). Works without a Docker daemon. Copies multi-architecture manifest lists and all tags in one command. Best for migrating many images or automating the migration in CI.

Option A: Gradual cut-over with an upstream proxy

Harness supports Amazon ECR as a first-class upstream proxy source type. When you configure a proxy with AWS ECR as the source, Harness uses the ECR authorization token automatically; you do not need to manage the 12-hour token refresh yourself.

Step 1: Create an upstream proxy pointing at ECR

  1. In the left navigation, go to Registries and select Create registry.

  2. Create a new Docker registry, or open an existing one.

  3. In the registry's Configuration tab, go to Upstream proxy and select Add upstream proxy.

  4. Create a new upstream proxy. Set Source to AWS ECR and enter your ECR credentials (AWS Access Key ID and Secret Access Key, or use an IAM role if your compute supports it).

  5. Save and add the proxy to your registry's upstream list.

Pipelines and clients that pull through this Harness registry will transparently fetch from ECR on first request. Once an image is cached in Harness, subsequent pulls serve from Harness directly.

Step 2: Update clients to pull from Harness

Update one pipeline or client at a time to pull from pkg.harness.io through the new registry. Monitor the Packages tab in the registry to confirm images are populating. When all pipelines have cut over and images are fully cached, you can decommission the ECR repository at your own pace.

Option B: Docker pull and push

Step 1: Log in to ECR

Replace <REGION> and <ACCOUNT_ID> with your AWS region and account ID.

Step 2: Log in to Harness Artifacts

Step 3: Pull, tag, and push each image

Scripting for multiple images

Use the AWS CLI to list all images in a repository and loop:

Option C: skopeo or crane (bulk copy)

skopeo and crane copy images between registries without a Docker daemon. They preserve multi-architecture manifest lists (--all) and can be run in CI without a privileged container.

Using skopeo

Install skopeo from your package manager or the skopeo releases page.

Authenticate to both registries:

Copy a single image (all tags and architectures):

Copy all tags in a repository:

Using crane

Install crane from the go-containerregistry releases page.

Authenticate:

Copy an image:

Copy all repositories in a script:

Verify the migration

Before switching production traffic, confirm that your images are available in Harness Artifacts.

  1. Open Registries in the left navigation and select your destination Docker registry.

  2. Go to the Packages tab and confirm the expected image names and tags are listed.

  3. Pull one image from Harness to confirm it resolves and matches the original:

Compare the digest against the source image in ECR. If images are missing, re-run the copy command with verbose logging to identify failures.

Update your clients and pipelines

After verifying, update the registry hostname in every place your images are referenced.

Docker clients and CI scripts: Replace <ACCOUNT_ID>.dkr.ecr.<REGION>.amazonaws.com with pkg.harness.io/<HARNESS_ACCOUNT_ID>/<REGISTRY>. Go to Docker client setup for the login and pull configuration.

Kubernetes workloads: Update spec.containers[*].image in your manifests, and update any imagePullSecrets to reference the Harness registry secret. Go to Docker client setup for the pull secret format.

Harness CI pipelines: Go to Harness CI integration to connect a Harness Artifacts registry to your build and push steps.

Harness CD deployments: Go to Harness CD integration to update artifact sources in your services.

Troubleshooting

ECR authorization token expired during migration

The ECR token from aws ecr get-login-password expires after 12 hours. For long-running migrations, run the login command again and resume. With skopeo and crane, you can wrap the copy commands in a script that re-authenticates before each batch.

Multi-architecture images are not preserved

The single-image docker pull + docker push approach pulls only the image for the local platform. Use skopeo copy --all or crane copy to copy the full manifest list and all platform variants.

Permission denied pushing to Harness Artifacts

Confirm your Harness PAT has push permission on the destination registry. Go to RBAC and permissions to check role assignments. The token must be scoped to the correct account, organization, and project.

Image not found when pulling from ECR

Confirm that the AWS credentials used have ecr:BatchGetImage and ecr:GetDownloadUrlForLayer permissions on the source repository. For cross-account ECR, the source account also needs a repository policy that grants access to the account or role running the migration.

Where do I find my Harness account ID?

Your account ID appears in the URL when you log in to Harness: app.harness.io/ng/account/<ACCOUNT_ID>. It also appears in the Setup Client panel: open any registry, go to the row menu, and select Setup Client.

For further help, contact Harness Support.

Last updated

Was this helpful?