官术网_书友最值得收藏!

Using a custom local registry

When it comes to choosing storage for your images, you are not limited to using the default Docker Hub. In fact, in most cases, when you are running production code, you may want to use a locally hosted Docker Registry, which is an open source, highly scalable application for storing and distributing Docker images. You should consider this solution in the following situations:

  • You want to distribute Docker images in an isolated network
  • You need strict control where the images are stored and distributed
  • You would like to compliment your CI/CD workflow to enable faster and more scalable delivery of images

Detailed information about the deployment of Docker Registry can be found in the official documentation: https://docs.docker.com/registry/deploying/.

For Kubernetes deployments, it is a common practice to host your own Docker Registry alongside or even inside the Kubernetes cluster. There are numerous automations available for this use case, for example, the official Helm chart for the deployment of registries on Kubernetes:  https://github.com/helm/charts/tree/master/stable/docker-registry.

In order to use a custom image registry, all you need to do is specify the registry address (and port, if needed) in the image name when using pull or push commands, for example, localregistry:5000/ptylenda/test-application:1.0.0, where localregistry:5000 is the domain name and port of a locally hosted Docker registry. In fact, you have already used a custom Docker image registry when you pulled images for your demonstration Windows IIS application: mcr.microsoft.com/windows/servercore/iis:windowsservercore-1903. The mcr.microsoft.com registry is the MCR, which is the official registry for Microsoft Published images. The main difference between other public registries and MCR is that it is tightly integrated with Docker Hub and leverages its UI for providing a browsable catalog of images. Docker Engine is capable of using any system that exposes the Docker Registry HTTP API (https://docs.docker.com/registry/spec/api/) as a container image registry.

Currently, it is not possible to change the default container image registry for Docker Engine. Unless you specify the registry address in the image name, the target registry will always be assumed to be docker.io.

Apart from hosting your own local image registry, there are a couple of cloud-based alternatives that provide private image registries:

In the next section, you will learn how to use Docker Hub to automate Docker image builds and how to host your own registry using ACR.

主站蜘蛛池模板: 利津县| 营山县| 尉犁县| 邵武市| 望江县| 侯马市| 桦南县| 利川市| 阳江市| 固始县| 张北县| 娄烦县| 和田市| 偏关县| 拉萨市| 南川市| 兴安盟| 永和县| 洞头县| 绵阳市| 彩票| 富民县| 万宁市| 陕西省| 中西区| 辽源市| 东兰县| 鄂托克旗| 冀州市| 兴国县| 淄博市| 崇左市| 理塘县| 阿尔山市| 邹城市| 托里县| 磐安县| 静宁县| 平泉县| 宣恩县| 太湖县|