Make your own Docker registry image

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

Make your own Docker registry image

  • The current registry separate project has been abandoned and replaced by distribution, which, to be sure, is the project registry , but above registry , its goal is to become a tool for content distribution, but image only a form of content.
  • Directly through distribution the Dockerfile , build the image, we found that the construction of the image is very large, about 380 m, and the official registry mirror size of only 30 m, this is not your build process has a problem, because the official distribution/image
    It's more than 300 m large.
  • Through distribution the study Dockerfile , it will be found that the mirror in the production process, the base image is from golang alpine the beginning, so the entire base image is very large, that is packaged in the registry image
    There golang is a compilation environment

    Ways to reduce mirroring

  • Modified distribution Dockerfile files, in the final cleanup phase, the go compilation environment is removed from the image, which will greatly reduce the size of the mirror
  • Use registry the official build image of the project Distribution-library-image to generate the image

    The first step ./update.sh tag is to update the binaries by going registry back to distribution by specifying tag or branch pulling up the latest distribution code, then using distribution the Dockerfile build image in, and then starting the container based on that image
    , copy the files from this container registry config-example.yml to the registry directory in this project, and then perform the
    DockerfileTo perform a build image

  • In accordance with the above principle, if you want to build your own fork modified registry project to generate registry image, only need to distribution-library-image the script of the update.sh official github address, to their own address can be

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.