{"id":20532455,"url":"https://github.com/joshdk/docker-retag","last_synced_at":"2025-10-17T11:42:40.024Z","repository":{"id":57497022,"uuid":"131664379","full_name":"joshdk/docker-retag","owner":"joshdk","description":"🐳 Retag an existing Docker image without the overhead of pulling and pushing","archived":false,"fork":false,"pushed_at":"2018-09-23T00:06:06.000Z","size":23,"stargazers_count":31,"open_issues_count":2,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-08T14:03:21.544Z","etag":null,"topics":["docker","docker-api","docker-hub","docker-image","docker-registry","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joshdk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-01T01:28:21.000Z","updated_at":"2025-03-21T08:21:50.000Z","dependencies_parsed_at":"2022-09-03T23:50:59.351Z","dependency_job_id":null,"html_url":"https://github.com/joshdk/docker-retag","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/joshdk/docker-retag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdk%2Fdocker-retag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdk%2Fdocker-retag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdk%2Fdocker-retag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdk%2Fdocker-retag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joshdk","download_url":"https://codeload.github.com/joshdk/docker-retag/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdk%2Fdocker-retag/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279335698,"owners_count":26150872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-17T02:00:07.504Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-api","docker-hub","docker-image","docker-registry","go","golang"],"created_at":"2024-11-16T00:14:58.287Z","updated_at":"2025-10-17T11:42:39.995Z","avatar_url":"https://github.com/joshdk.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CircleCI][circleci-badge]][circleci-link]\n[![Go Report Card][go-report-card-badge]][go-report-card-link]\n[![License][license-badge]][license-link]\n[![Github downloads][github-downloads-badge]][github-release-link]\n[![GitHub release][github-release-badge]][github-release-link]\n\n# Docker Retag\n\n🐳 Retag an existing Docker image without the overhead of pulling and pushing\n\n## Motivation\n\nThere are certain situation where it is desirable to give an existing Docker image an additional tag. This is usually acomplished by a `docker pull`, followed by a `docker tag` and a `docker push`.\n\nThat approach has the downside of downloading the contents of every layer from Docker Hub, which has bandwidth and performance implications, especially in a CI environment.\n\nThis tool uses the [Docker Hub API](https://docs.docker.com/registry/spec/api/) to pull and push only a tiny [manifest](https://docs.docker.com/registry/spec/manifest-v2-2/) of the layers, bypassing the download overhead. Using this approach, an image of any size can be retagged in approximately 2 seconds.\n\n## Installing\n\n### From source\n\nYou can use `go get` to install this tool by running:\n\n```bash\n$ go get -u github.com/joshdk/docker-retag\n```\n\n### Precompiled binary\n\nAlternatively, you can download a static Linux [release][github-release-link] binary by running:\n\n```bash\n$ wget -q https://github.com/joshdk/docker-retag/releases/download/0.0.2/docker-retag\n$ sudo install docker-retag /usr/bin\n```\n\n## Usage\n\n### Setup\n\nSince `docker-retag` communicates with the [Docker Hub](https://hub.docker.com/) API, you must first export your account credentials into the working environment. These are the same credentials that you would use during `docker login`.\n\n```bash\n$ export DOCKER_USER='joshdk'\n$ export DOCKER_PASS='hunter2'\n```\n\nThe credentials must have both pull and push access for the Docker repository you are retagging.\n\n### Examples\n\nThis tool can be used in a few simple ways. The simplest of which is using a\nsource image reference (similar to anything you could pass to `docker tag`) and\na target tag.\n\n##### Referencing a source image by tag name.\n\n```bash\n$ docker-retag joshdk/hello-world:1.0.0 1.0.1\n  Retagged joshdk/hello-world:1.0.0 as joshdk/hello-world:1.0.1\n```\n\n##### Referencing a source image by `sha256` digest.\n\n```bash\n$ docker-retag joshdk/hello-world@sha256:933f...3e90 1.0.1\n  Retagged joshdk/hello-world@sha256:933f...3e90 as joshdk/hello-world:1.0.1\n```\n\n##### Referencing an image only by name will default to using `latest`.\n\n```bash\n$ docker-retag joshdk/hello-world 1.0.1\n  Retagged joshdk/hello-world:latest as joshdk/hello-world:1.0.1\n```\n\nAdditionally, you can pass the image name, source reference, and target tag as seperate arguments.\n\n```bash\n$ docker-retag joshdk/hello-world 1.0.0 1.0.1\n  Retagged joshdk/hello-world:1.0.0 as joshdk/hello-world:1.0.1\n```\n\n```bash\n$ docker-retag joshdk/hello-world @sha256:933f...3e90 1.0.1\n  Retagged joshdk/hello-world@sha256:933f...3e90 as joshdk/hello-world:1.0.1\n```\n\nIn all cases, the image and source reference **must** already exist in Docker Hub.\n\n## License\n\nThis library is distributed under the [MIT License][license-link], see [LICENSE.txt][license-file] for more information.\n\n[circleci-badge]:         https://circleci.com/gh/joshdk/docker-retag.svg?\u0026style=shield\n[circleci-link]:          https://circleci.com/gh/joshdk/docker-retag/tree/master\n[github-downloads-badge]: https://img.shields.io/github/downloads/joshdk/docker-retag/total.svg\n[github-release-badge]:   https://img.shields.io/github/release/joshdk/docker-retag.svg\n[github-release-link]:    https://github.com/joshdk/docker-retag/releases/latest\n[go-report-card-badge]:   https://goreportcard.com/badge/github.com/joshdk/docker-retag\n[go-report-card-link]:    https://goreportcard.com/report/github.com/joshdk/docker-retag\n[license-badge]:          https://img.shields.io/github/license/joshdk/docker-retag.svg\n[license-file]:           https://github.com/joshdk/docker-retag/blob/master/LICENSE.txt\n[license-link]:           https://opensource.org/licenses/MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshdk%2Fdocker-retag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshdk%2Fdocker-retag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshdk%2Fdocker-retag/lists"}