{ "info": { "author": "Anton Patsev", "author_email": "patsev.anton@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Utilities" ], "description": "|CircleCI|\n\nregistry-cli\n============\n\nregistry.py is a script for easy manipulation of docker-registry from\ncommand line (and from scripts)\n\nInstallation\n------------\n\nDocker image\n~~~~~~~~~~~~\n\nYou can download ready-made docker image with the script and all python\ndependencies pre-installed:\n\n::\n\n docker pull anoxis/registry-cli\n\nIn this case, in replace\n\n::\n\n registry.py\n\nwith\n\n::\n\n docker run --rm anoxis/registry-cli \n\nin all commands below, e.g.\n\n::\n\n docker run --rm anoxis/registry-cli -r http://example.com:5000\n\nNote: when you use the docker image and registry on the same computer\n(registry is on localhost), then due to internal network created by\ndocker you have to link to the registry's network and refer registry\ncontainer by its name, not localhost. E.g. your registry container is\nnamed \"registry\", then the command to launch registry-cli would be\n\n.. code:: bash\n\n docker run --rm --link registry anoxis/registry-cli -r http://registry:5000\n\npython script\n~~~~~~~~~~~~~\n\nDownload registry.py and set it as executable\n\n::\n\n chmod 755 registry.py\n\nInstall dependencies:\n\n::\n\n sudo pip install -r requirements.txt\n\nListing images\n--------------\n\nThe below command will list all images and all tags in your registry:\n\n::\n\n registry.py -l user:pass -r https://example.com:5000\n\nList all images, tags and layers:\n\n::\n\n registry.py -l user:pass -r https://example.com:5000 --layers\n\nList particular image(s) or image:tag (all tags of ubuntu and alpine in\nthis example)\n\n::\n\n registry.py -l user:pass -r https://example.com:5000 -i ubuntu alpine\n\nSame as above but with layers\n\n::\n\n registry.py -l user:pass -r https://example.com:5000 -i ubuntu alpine --layers\n\nUsername and password\n---------------------\n\nIt is optional, you can omit it in case if you use insecure registry\nwithout authentication (up to you, but its really insecure; make sure\nyou protect your entire registry from anyone)\n\nusername and password pair can be provided in the following forms\n\n::\n\n -l username:password\n -l 'username':'password'\n -l \"username\":\"password\"\n\nUsername cannot contain colon (':') (I don't think it will contain ever,\nbut anyway I warned you). Password, in its turn, can contain as many\ncolons as you wish.\n\nDeleting images\n---------------\n\nKeep only last 10 versions (useful for CI): Delete all tags of all\nimages but keep last 10 tags (you can put this command to your build\nscript after building images)\n\n::\n\n registry.py -l user:pass -r https://example.com:5000 --delete\n\nIf number of tags is less than 10 it will not delete any\n\nYou can change the number of tags to keep, e.g. 5:\n\n::\n\n registry.py -l user:pass -r https://example.com:5000 --delete --num 5\n\nYou may also specify tags to be deleted using a list of regexp based\nnames. The following command would delete all tags containing\n\"snapshot-\" and beginning with \"stable-\" and a 4 digit number:\n\n::\n\n registry.py -l user:pass -r https://example.com:5000 --delete --tags-like \"snapshot-\" \"^stable-[0-9]{4}.*\"\n\nAs one manifest may be referenced by more than one tag, you may add\ntags, whose manifests should NOT be deleted. A tag that would otherwise\nbe deleted, but whose manifest references one of those \"kept\" tags, is\nspared for deletion. In the following case, all tags beginning with\n\"snapshot-\" will be deleted, safe those whose manifest point to \"stable\"\nor \"latest\"\n\n::\n\n registry.py -l user:pass -r https://example.com:5000 --delete --tags-like \"snapshot-\" --keep-tags \"stable\" \"latest\"\n\nThe last parameter is also available as regexp option with\n\"--keep-tags-like\".\n\nDelete all tags for particular image (e.g. delete all ubuntu tags):\n\n::\n\n registry.py -l user:pass -r https://example.com:5000 -i ubuntu --delete-all\n\nDelete all tags for all images (do you really want to do it?):\n\n::\n\n registry.py -l user:pass -r https://example.com:5000 --delete-all\n\nDisable ssl verification\n------------------------\n\nIf you are using docker registry with a self signed ssl certificate, you\ncan disable ssl verification:\n\n::\n\n registry.py -l user:pass -r https://example.com:5000 --no-validate-ssl \n\nImportant notes:\n----------------\n\ngarbage-collection in docker-registry\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n1. docker registry API does not actually delete tags or images, it marks\n them for later garbage collection. So, make sure you run something\n like below (or put them in your crontab):\n\n ::\n\n cd [path-where-your-docker-compose.yml]\n docker-compose stop registry\n docker-compose run --rm \\\n registry bin/registry garbage-collect \\\n /etc/docker/registry/config.yml\n docker-compose up -d registry\n\n or (if you are not using docker-compose):\n\n ::\n\n docker stop registry:2\n docker run --rm registry:2 bin/registry garbage-collect \\\n /etc/docker/registry/config.yml\n docker start registry:2\n\n for more detail on garbage collection read here:\n https://docs.docker.com/registry/garbage-collection/\n\nenable image deletion in docker-registry\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nMake sure to enable it by either creating environment variable\n``REGISTRY_STORAGE_DELETE_ENABLED: \"true\"`` or adding relevant\nconfiguration option to the docker-registry's config.yml. For more on\ndocker-registry configuration, read here:\nhttps://docs.docker.com/registry/configuration/\n\nYou may get ``Error 405`` message from script\n(``Functionality not supported``) when this option is not enabled.\n\nContribution\n------------\n\nYou are very welcome to contribute to this script. Of course, when\nmaking changes, please include your changes into ``test.py`` and run\ntests to check that your changes do not break existing functionality.\n\nFor tests to work, install ``mock`` library\n\n::\n\n pip install -r requirements-test.txt\n\nRunning tests is as simple as\n\n::\n\n python test.py\n\nTest will print few error messages, like so\n\n::\n\n Testing started at 9:31 AM ...\n tag digest not found: 400\n error 400\n\nthis is ok, because test simulates invalid inputs also.\n\nContact\n=======\n\nPlease feel free to contact me at anoxis@gmail.com if you wish to add\nmore functionality or want to contribute.\n\n.. |CircleCI| image:: https://circleci.com/gh/andrey-pohilko/registry-cli/tree/master.svg?style=svg&circle-token=5216bf89763aec24bbcd6d15494ea32ffc53d66d\n :target: https://circleci.com/gh/andrey-pohilko/registry-cli/tree/master\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/patsevanton/registry-cli", "keywords": "docker registry cli", "license": "", "maintainer": "", "maintainer_email": "", "name": "registry-cli-apatsev", "package_url": "https://pypi.org/project/registry-cli-apatsev/", "platform": "", "project_url": "https://pypi.org/project/registry-cli-apatsev/", "project_urls": { "Homepage": "https://github.com/patsevanton/registry-cli" }, "release_url": "https://pypi.org/project/registry-cli-apatsev/0.1.2/", "requires_dist": null, "requires_python": "", "summary": "registry.py is a script for easy manipulation of docker-registry from command line (and from scripts)", "version": "0.1.2" }, "last_serial": 3507096, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "455df67375337533cf645437c5e9a7da", "sha256": "c23f349a183574eee21ff139dfec7d16e449f4f277b252f57e0663eff5944090" }, "downloads": -1, "filename": "registry-cli-apatsev-0.1.tar.gz", "has_sig": false, "md5_digest": "455df67375337533cf645437c5e9a7da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4518, "upload_time": "2018-01-20T12:19:36", "url": "https://files.pythonhosted.org/packages/66/82/834c8883d4b9a37cf46b034c710909ba6a3b6b65af314b68153aed5b4675/registry-cli-apatsev-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "87f6c769f916412b52a09f7c1f180453", "sha256": "9418486fc3a6a2c0cfed9d2b8c7d53c7a4912fe2e4c11d27b20cf1c2547932ee" }, "downloads": -1, "filename": "registry-cli-apatsev-0.1.1.tar.gz", "has_sig": false, "md5_digest": "87f6c769f916412b52a09f7c1f180453", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4605, "upload_time": "2018-01-20T12:27:45", "url": "https://files.pythonhosted.org/packages/7e/74/6cb56478a293a2e438b2224af8261c829d9e331328b6920bfd4fcfa257de/registry-cli-apatsev-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "a1d680be8f156d65e61d25851bfd8c98", "sha256": "4487496dfcc6013a39260bee032c3cadeac400aac8b23220a546d73fc6284eb4" }, "downloads": -1, "filename": "registry-cli-apatsev-0.1.2.tar.gz", "has_sig": false, "md5_digest": "a1d680be8f156d65e61d25851bfd8c98", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4662, "upload_time": "2018-01-20T13:52:49", "url": "https://files.pythonhosted.org/packages/49/37/fa6a446774990848b501823aeeed17eea6d468d8d57d57957835614d465e/registry-cli-apatsev-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a1d680be8f156d65e61d25851bfd8c98", "sha256": "4487496dfcc6013a39260bee032c3cadeac400aac8b23220a546d73fc6284eb4" }, "downloads": -1, "filename": "registry-cli-apatsev-0.1.2.tar.gz", "has_sig": false, "md5_digest": "a1d680be8f156d65e61d25851bfd8c98", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4662, "upload_time": "2018-01-20T13:52:49", "url": "https://files.pythonhosted.org/packages/49/37/fa6a446774990848b501823aeeed17eea6d468d8d57d57957835614d465e/registry-cli-apatsev-0.1.2.tar.gz" } ] }