Image management in the Docker private warehouse registry

Source: Internet
Author: User
Tags docker registry

How do I remove a mirror from a private registry?

First, by default, Docker registry is not allowed to remove mirrors and needs to be enabled in the configuration config.yml : vim/etc/docker/registry/config.yml

0.1 log: Fields  :    service:registrystorage:  Delete:    true   Cache:    blobdescriptor:inmemory  filesystem:    /var/lib/registryhttp:  Addr::  headers:    X-content-type-Options: [Nosniff]health:  Storagedriver:    true    interval:10s    3


2.3after Registry, must join the head Accept: application/vnd.docker.distribution.manifest.v2+json , otherwise take digest is wrong, this is to prevent the accidental deletion. then, use the API GET /v2/<镜像名>/manifests/<tag> to get the 镜像:Tag corresponding that digest you want to delete .

For example, to delete a myimage:latest mirror, digest the command obtained is:

Curl-i http://10.0.30.6:5000/v2/house/hello/manifests/  

Docker-content-digest:sha256:631c0331832510e025cda643a59f92d754c823967176422999b9f87e42b47eb1

Then call the DELETE /v2/<镜像名>/manifests/<digest> API to remove the mirror. Like what:

curl-x DELETE http://192.168.99.100:5000/v2/myimage/manifests/sha256 : 3a07b4e06c73b2e3924008270c7f3c3c6e3f70d4dbb814ad8bff2697123ca33c

At this point, the image has been registry removed from the mark and the external access pull is not available. However registry , the local space is not released and needs to wait for garbage collection to be released. While garbage collection cannot be done online, it must be stopped and registry then executed. For example, if registry you run with Compose, the following command is used for garbage collection:

Docker-compose stopdocker run-it--name gc--rm--volumes-from registry_registry_1 Registry:2 Garbage-collect/etc/regis Try/config.ymldocker-compose start

registry_registry_1it can be replaced with the actual registry container name and replaced with the /etc/registry/config.yml actual registry profile path.

Image management in the Docker private warehouse registry

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.