{"id":22174995,"url":"https://github.com/morningspace/docker-registry-cli","last_synced_at":"2025-07-26T15:32:16.330Z","repository":{"id":48140947,"uuid":"173682752","full_name":"morningspace/docker-registry-cli","owner":"morningspace","description":"Command line utility written in Bash Shell for easy and flexible manipulation of Docker registry that supports V2 API","archived":false,"fork":false,"pushed_at":"2019-06-14T09:26:27.000Z","size":31,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-03T22:57:09.598Z","etag":null,"topics":["bash","cli","command-line","docker","registry","shell","utility"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/morningspace.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-04T05:59:48.000Z","updated_at":"2022-09-01T17:04:09.000Z","dependencies_parsed_at":"2022-09-01T09:10:54.187Z","dependency_job_id":null,"html_url":"https://github.com/morningspace/docker-registry-cli","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morningspace%2Fdocker-registry-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morningspace%2Fdocker-registry-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morningspace%2Fdocker-registry-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morningspace%2Fdocker-registry-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/morningspace","download_url":"https://codeload.github.com/morningspace/docker-registry-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227692781,"owners_count":17805208,"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","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":["bash","cli","command-line","docker","registry","shell","utility"],"created_at":"2024-12-02T07:55:43.854Z","updated_at":"2024-12-02T07:55:44.614Z","avatar_url":"https://github.com/morningspace.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Registry CLI ![version v0.1](https://img.shields.io/badge/version-v0.1-brightgreen.svg) ![License MIT](https://img.shields.io/badge/license-MIT-blue.svg)\n\nDocker Registry CLI is a command line utility written in Bash Shell for easy and flexible manipulation of Docker registry that supports [V2 API](https://docs.docker.com/registry/spec/api/).\n\nYou can watch the tutorial **\"Docker Registry CLI Tutorial\"** video series on [YouTube](https://www.youtube.com/watch?v=j_Bd4G5aGXA\u0026list=PLVQM6jLkNkfomYfooLTUmbaNlImMHkDTE) or [YouKu](https://v.youku.com/v_show/id_XNDE3ODk0NTk4MA==.html?f=52175776). Or, read the corresponding posts on [晴耕小筑](https://morningspace.github.io/tags/#studio-reg-cli).\n\n| Title | Links\n| ---- \t|:----\n| Docker Registry CLI Tutorial - Basic Use | [Post](https://morningspace.github.io/tech/reg-cli-tutorial-1/) [YouTube](https://youtu.be/j_Bd4G5aGXA) [YouKu](https://v.youku.com/v_show/id_XNDE3ODk0NTk4MA==.html?f=52175776)\n| Docker Registry CLI Tutorial - More Use  | [Post](https://morningspace.github.io/tech/reg-cli-tutorial-2/) [YouTube](https://youtu.be/wySn3fvtmdE) [YouKu](https://v.youku.com/v_show/id_XNDE5Nzk2OTA3Mg==.html?f=52175776)\n| Docker Registry CLI轻松管理Docker注册表(上) | [文章](https://morningspace.github.io/tech/use-docker-reg-cli-1/)\n| Docker Registry CLI轻松管理Docker注册表(下) | [文章](https://morningspace.github.io/tech/use-docker-reg-cli-2/)\n\n## Table of Contents\n* [Why Different](#why-different)\n* [How to Run](#how-to-run)\n  * [Inside Container](#inside-container)\n  * [From Git Repository](#from-git-repository)\n  * [Outside container](#outside-container)\n* [How to Use](#how-to-use)\n  * [Copy Images between Registries](#copy-images-between-registries)\n  * [List images and More](#list-images-and-more)\n  * [Remove Images and Tags](#remove-images-and-tags)\n* [Notes](#notes)\n* [Contact](#contact)\n\n## Why Different\n\n* *Copy in batch*: To copy images in batch is one interesting feature provided by the cli. It can be used to copy multiple images from different sources including both private and public registries to the target registry so that you can setup your own private registry easily.\n* *Based on DIND*: The cli provides a Docker image based on [DIND(Docker-in-Docker)](https://github.com/jpetazzo/dind). By using DIND, not only the cli can be run inside container, it can even run docker commands in container without polluting the local registry cache on your host machine.\n* *Less is more*: With the combination of a very little set of commands and options, it provides quite a few features to manipulate the registry. See \"[How to Use](#how-to-use)\" for details.\n* *Easy to use*: The design rationale behind the cli is to reference existing linux command syntax as much as possible. So, it's fairly easy to learn and use if you are familiar with some ordinary linux commands such as `ls`, `rm`, and `cp`.\n\n## How to Run\n\nDocker Registry CLI can be run both inside and outside Docker container.\n\n### Inside Container\n\nIt's much easier to run inside container since it has all dependencies installed and a soft link created for the shell script so that you can run the cli from anywhere in container.\n\nAnother advantage to run inside container is that it won't pollute the local registry cache on your host machine when run the cli copy command to copy images between registries, because the dockerized cli is based on [DIND(Docker-in-Docker)](https://github.com/jpetazzo/dind). If you exist the container after get the work done, nothing will be left.\n\nThe cli has been built as a Docker image and published to [Docker Hub](https://cloud.docker.com/u/morningspace/repository/docker/morningspace/docker-registry-cli). You can run below command to pull it to your local machine:\n\n```shell\ndocker pull morningspace/docker-registry-cli\n```\n\nThen start the container to launch Docker daemon:\n\n```shell\ndocker run --privileged --name reg-cli -d morningspace/docker-registry-cli\n```\n\nAnd connect to it from another container to run the cli:\n\n```shell\ndocker exec -it reg-cli bash\n```\n\n### From Git Repository\n\nYou can clone the [Git repository](https://github.com/morningspace/docker-registry-cli) directly to your local to run the cli. There are docker-compose YAML file and some sample configurations distributed along with the cli.\n\nTo try it out, run docker-compose as below to launch the daemon and a sample private registry `mr.io` for your testing:\n\n```shell\ndocker-compose up -d\n```\n\nThen connect to the daemon from another container to run the cli:\n\n```shell\ndocker-compose exec registry-cli bash\n```\n\n### Outside Container\n\nTo run outside container, you need to install its dependencies at first. See \"[Dependencies](#dependencies)\" for details.\n\n## How to Use\n\nRun `reg-cli` inside container or `reg-cli.sh` outside container, it will give you help information by default including the usage syntax and examples.\n\n### Copy Images between Registries\n\nJust like the linux `cp` command to copy directories and files, to copy one or more images and tags between registries, all can be done by `reg-cli cp` command.\n\nWhen specify an image with one or more tags separated by comma, it can copy one or more images with their tags to target registry. Without specifying any tag, it will copy the image with `latest` tag. The source registries can be private registries or public registries such as Docker Hub:\n\n```shell\n# copy an image with a tag to a registry\nreg-cli cp morningspace/lab-web:1.0 mr.io\n\n# copy an image with multiple tags to a registry\nreg-cli cp morningspace/lab-web:1.0,latest mr.io\n\n# copy an image with latest tag to a registry\nreg-cli cp morningspace/lab-web mr.io\n```\n\nLike the linux `cp` command, it also supports to copy multiple items:\n\n```shell\n# copy multiple images to a registry\nreg-cli cp morningspace/lab-web morningspace/lab-lb mr.io\n```\n\nWhen specify registry instead of image, it can even copy all configured images with their tags to target registry. This is done by a pre-configured `.list` file which includes all images that you want to copy from source registry. One image per line. When specify the registry, it will look for the `.list` file in current folder where the file name is the registry name:\n\n```shell\n# copy images to a registry by reading morningspace.list file\nreg-cli cp morningspace mr.io\n```\n\nMoreover, the `.list` files can be organized in a nested manner, where entries defined in `.list` file can also be registries. The cli will parse `.list` files recursively. See `.list` sample files distributed along with the cli in folder `/samples/registries`.\n\n### List Images and More\n\nJust like the linux `ls` command to list directories and files, to list registry catalog, image tags, digests and manifests, all can be done by `reg-cli ls` command.\n\nWhen specify an image, it lists tags for that image by default(or using `-lt`). It can also list digests using `-ld`, or manifest using `-lm`. Here are some examples:\n\n```shell\n# list all tags for an image\nreg-cli ls mr.io/alpine\n\n# list digests for all tags of an image\nreg-cli ls -ld mr.io/alpine\n\n# list manifests for all tags of an image\nreg-cli ls -lm mr.io/alpine\n\n# list digest for a tag of an image\nreg-cli ls -ld mr.io/alpine:latest\n\n# list manifest for a tag of an image\nreg-cli ls -lm mr.io/alpine:latest\n```\n\nLike the linux `ls` command, it also supports to list multiple items:\n\n```shell\n# list tags for multiple images\nreg-cli ls mr.io/alpine mr.io/busybox\n\n# list digests for multiple images with their tags\nreg-cli ls -ld mr.io/alpine:latest mr.io/busybox:1.26.2\n```\n\nWhen specify registry instead of image, it can even list all images, or tags, digests, manifests of images on that registry:\n\n```shell\n# list all images on a registry\nreg-cli ls mr.io\n\n# list tags for all images on a registry\nreg-cli ls mr.io -lt\n\n# list digests for all images on a registry\nreg-cli ls mr.io -ld\n\n# list manifests for all images on a registry\nreg-cli ls mr.io -lm | less\n```\n\n### Remove Images and Tags\n\nJust like the linux `rm` command to remove directories or files, to remove one or more images and tags, all can be done by `reg-cli rm` command.\n\nWhen specify an image with one or more tags separated by comma, it can remove one or more tags of that image. Without specifying any tag, it will remove all tags for that image:\n\n```shell\n# remove a tag for an image\nreg-cli rm mr.io/alpine:latest\n\n# remove multiple tags for an image\nreg-cli rm mr.io/alpine:3.9,latest\n\n# remove all tags for one image\nreg-cli rm mr.io/alpine\n```\n\nLike the linux `rm` command, it also supports to remove multiple items:\n\n```shell\n# remove tags for multiple images\nreg-cli rm mr.io/alpine:3.9 mr.io/busybox\n```\n\nAnd, use `-f` to enforce removal without user prompt:\n\n```shell\n# force remove\nreg-cli rm -f mr.io/alpine:latest\n```\n\n## Notes\n\n* *Enable image deletion*: Before run the `reg-cli rm` command, make sure you have enabled `image deletion` on the registry. Otherwise, you may get 405 Error when run the command. This can be configured by either defining environment variable `REGISTRY_STORAGE_DELETE_ENABLED` to be `\"true\"` or adding corresponding configuration option to `config.yml` on the registry. See [here](https://docs.docker.com/registry/configuration/#delete) for details.\n\n* *Dependencies*: The cli needs `bash`, `curl`, `jq`, `docker` to be installed as its dependencies. You may need to install some of them by yourself if run outside container and they do not exist.\n\n* *Alternatives*: There are [other alternatives](https://github.com/search?q=docker+registry+cli\u0026type=Repositories) that can be found on GitHub. Most of them are written in `Go` or `Python`. See \"[Why Different](#why-it-is-different)\" to understand why Docker Registry CLI is different from others.\n\n## Contact\n\nFeel free to contact me at morningspace@yahoo.com if you want to contribute.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorningspace%2Fdocker-registry-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorningspace%2Fdocker-registry-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorningspace%2Fdocker-registry-cli/lists"}