Skip to main content

Docker ECR Mirror

Mirror public docker images to ECR, automagically. This requires Skopeo to be installed.

pip install ecr-mirror

Usage

$ ecr-mirror
Usage: ecr-mirror [OPTIONS] COMMAND [ARGS]...

Options:
  --registry-id TEXT    The registry ID. This is usually your AWS account ID.
  --role-arn TEXT       Assume a specific role to push to AWS
  --override-os TEXT    Specify the OS of images, default to "linux"
  --override-arch TEXT  Specify the ARCH of images, default to "amd64". If set
                        to "all" - all architectures will be synced

  --help                Show this message and exit.

Commands:
  copy        Copy all tags that match a given glob expression into ECR
  list-repos  List all repositories that will be synced
  sync        Copy public images to ECR using ECR tags

Create an ECR repository with the following two tags set:

  • upstream-image set to a public Docker hub image, i.e nginx or istio/proxyv2
  • upstream-tags set to a /-separated list of tag globs, i.e 1.6.* or just 1.2-alpine. ECR does not allow the use of the * character in tag values, so you should use + as a replacement.
  • ignore-tags set to a /-separated list of tag globs to ignore. ECR does not allow the use of the * character in tag values, so you should use + as a replacement.

Terraform example:

resource "aws_ecr_repository" "repo" {
  name = "nginx"
  tags = {
    upstream-image = "nginx",
    // Mirror 1.16* and 1.17*
    upstream-tags = "1.16+/1.17+"
    ignore-tags = "+-gpu"
  }
}

Running ecr-mirror sync will begin concurrently fetching all images and pushing them to ECR.

You can run ecr-mirror list to see all repositories that will be mirrored.

You can also manually copy specific image patterns using ecr-mirror copy:

ecr-mirror copy "istio/proxyv2:1.6.*" ACCOUNT_ID.dkr.ecr.eu-west-1.amazonaws.com/istio-proxyv2

Metadata

Release files for ecr-mirror 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ecr-mirror 1.3.0
File Size Uploaded Provenance
ecr_mirror-1.3.0.tar.gz 4.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ecr-mirror 1.3.0
File Interpreter ABI Platform
ecr_mirror-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.8 kB

Release files / ecr_mirror-1.3.0.tar.gz

Download URL ecr_mirror-1.3.0.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ac8ccb5411ebacd97d74b29f4255465a0e9abe12f34dab2b87ce865e99577bd7
BLAKE2b-256 checksum
How to use checksums
d460022bf281f63b07f7bdae5fcaccc356e719201ee0e864a67a9eb958584e05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.1 CPython/3.11.0 Darwin/22.1.0

Release files / ecr_mirror-1.3.0-py3-none-any.whl

Download URL ecr_mirror-1.3.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86a7985851c3d64a8c9f171f2aca2a1adf3e4ba7c7c5fde39a14716018795a1b
BLAKE2b-256 checksum
How to use checksums
3b712218b36e0df1d2b12f91f58b0bd31ed8719c47bbb85468b3adb50e2e6695
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.1 CPython/3.11.0 Darwin/22.1.0

Security for ecr-mirror 1.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page