ecr_sync


Nameecr_sync JSON
Version 2.0.0 PyPI version JSON
download
home_pageNone
SummaryMirror and synchronize OCI Docker images to ECR repositories
upload_time2024-03-21 09:37:47
maintainerNone
docs_urlNone
authorTom Forbes
requires_python<4.0,>=3.10
licenseMIT
keywords docker ecr mirror sync
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Docker ECR Sync

![](https://img.shields.io/pypi/v/ecr-mirror.svg)
![](https://img.shields.io/pypi/l/ecr-mirror.svg)
![](https://img.shields.io/pypi/pyversions/ecr-mirror.svg)

Mirror public docker images to ECR, automagically. This requires [Skopeo](https://github.com/containers/skopeo) to be installed.

`pip install ecr-mirror`

## Usage

```
$ ecr-sync
Usage: ecr-sync [OPTIONS] COMMAND [ARGS]...

Options:
  --registry-id, --reg TEXT       The registry ID. This is usually your AWS
                                  account ID.  [required]
  --role-name TEXT                Assume a specific role to push to AWS
  --override-os TEXT              Specify the OS of images, default to "linux"
  --override-arch [amd64|arm64|windows-amd64|all]
                                  Specify the ARCH of images, default to
                                  "amd64". If set to "all" - all architectures
                                  will be synced
  --profile-name TEXT             The name of the AWS profile to use
  --verbose                       Enable verbose output
  --dry-run                       Enable dry run
  --debug                         Enable debug output
  --public                        Use ECR Public instead of ECR
  --docker-username TEXT          The username to use for docker login
  --docker-password TEXT          The password to use for docker login
  --threads INTEGER               The number of threads to use for copying
                                  images
  --help                          Show this message and exit.
```

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.

Optional:
* `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:

```hcl
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-sync sync` will begin concurrently fetching matched images tags and pushing them to ECR.

You can run `ecr-sync list-repos` 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`

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "ecr_sync",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "docker, ecr, mirror, sync",
    "author": "Tom Forbes",
    "author_email": "tom.forbes@onfido.com",
    "download_url": "https://files.pythonhosted.org/packages/56/19/36bd9148a72df8bdfc19e98c681cf935219d104252e6cde32c108d706f2e/ecr_sync-2.0.0.tar.gz",
    "platform": null,
    "description": "# Docker ECR Sync\n\n![](https://img.shields.io/pypi/v/ecr-mirror.svg)\n![](https://img.shields.io/pypi/l/ecr-mirror.svg)\n![](https://img.shields.io/pypi/pyversions/ecr-mirror.svg)\n\nMirror public docker images to ECR, automagically. This requires [Skopeo](https://github.com/containers/skopeo) to be installed.\n\n`pip install ecr-mirror`\n\n## Usage\n\n```\n$ ecr-sync\nUsage: ecr-sync [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n  --registry-id, --reg TEXT       The registry ID. This is usually your AWS\n                                  account ID.  [required]\n  --role-name TEXT                Assume a specific role to push to AWS\n  --override-os TEXT              Specify the OS of images, default to \"linux\"\n  --override-arch [amd64|arm64|windows-amd64|all]\n                                  Specify the ARCH of images, default to\n                                  \"amd64\". If set to \"all\" - all architectures\n                                  will be synced\n  --profile-name TEXT             The name of the AWS profile to use\n  --verbose                       Enable verbose output\n  --dry-run                       Enable dry run\n  --debug                         Enable debug output\n  --public                        Use ECR Public instead of ECR\n  --docker-username TEXT          The username to use for docker login\n  --docker-password TEXT          The password to use for docker login\n  --threads INTEGER               The number of threads to use for copying\n                                  images\n  --help                          Show this message and exit.\n```\n\nCreate an ECR repository with the following two tags set:\n\n* `upstream-image` set to a public Docker hub image, i.e `nginx` or `istio/proxyv2`\n* `upstream-tags` set to a `/`-separated list of tag **globs**, i.e `1.6.*` or just `1.2-alpine`. ECR does not allow the\n  use of the `*` character in tag values, so you should use `+` as a replacement.\n\nOptional:\n* `ignore-tags` set to a `/`-separated list of tag **globs** to ignore. ECR does not allow the\n  use of the `*` character in tag values, so you should use `+` as a replacement.\n\nTerraform example:\n\n```hcl\nresource \"aws_ecr_repository\" \"repo\" {\n  name = \"nginx\"\n  tags = {\n    upstream-image = \"nginx\",\n    // Mirror 1.16* and 1.17*\n    upstream-tags = \"1.16+/1.17+\"\n    ignore-tags = \"+-gpu\"\n  }\n}\n```\n\nRunning `ecr-sync sync` will begin concurrently fetching matched images tags and pushing them to ECR.\n\nYou can run `ecr-sync list-repos` to see all repositories that will be mirrored.\n\nYou can also manually copy specific image patterns using `ecr-mirror copy`:\n\n`ecr-mirror copy \"istio/proxyv2:1.6.*\" ACCOUNT_ID.dkr.ecr.eu-west-1.amazonaws.com/istio-proxyv2`\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Mirror and synchronize OCI Docker images to ECR repositories",
    "version": "2.0.0",
    "project_urls": null,
    "split_keywords": [
        "docker",
        " ecr",
        " mirror",
        " sync"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2b5ae6e328d995c14a704667cdeda4ed1d4bdac2e82f037a33c9f89f3e60f190",
                "md5": "45fe23a15ee63388be3a98b660a3bdc6",
                "sha256": "8248bcfc9f3e4a525528c1cb6adf57883e95590e1caf3a3174fa7bbc85232381"
            },
            "downloads": -1,
            "filename": "ecr_sync-2.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "45fe23a15ee63388be3a98b660a3bdc6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 6599,
            "upload_time": "2024-03-21T09:37:45",
            "upload_time_iso_8601": "2024-03-21T09:37:45.847025Z",
            "url": "https://files.pythonhosted.org/packages/2b/5a/e6e328d995c14a704667cdeda4ed1d4bdac2e82f037a33c9f89f3e60f190/ecr_sync-2.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "561936bd9148a72df8bdfc19e98c681cf935219d104252e6cde32c108d706f2e",
                "md5": "fbdc02bfa44ba0f34c434e54ca14bd2e",
                "sha256": "d8f34b87eb8a407ef99879a23d70b13e578f58928d30a2d9105daa051223c07e"
            },
            "downloads": -1,
            "filename": "ecr_sync-2.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "fbdc02bfa44ba0f34c434e54ca14bd2e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 5734,
            "upload_time": "2024-03-21T09:37:47",
            "upload_time_iso_8601": "2024-03-21T09:37:47.178488Z",
            "url": "https://files.pythonhosted.org/packages/56/19/36bd9148a72df8bdfc19e98c681cf935219d104252e6cde32c108d706f2e/ecr_sync-2.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-21 09:37:47",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "ecr_sync"
}
        
Elapsed time: 0.24643s