Introduction
This article’s subject or content have already been exist in the previous article. It exist in ‘How to Run Local Docker Repository in Microsoft Windows‘. Just as a reminder with specific part in it, this article will describe it once more about how to be able to create and run a local or private docker repository registry. In the context of this article, it will also still use the local device which is running using Microsoft Windows.
Preparation
Before getting in to the process for creating a local or private Docker Repository Registry, just make sure to do some preparations. The first preparation is for starting the Docker service engine. Read the article for starting Docker engine service in an article titled ‘How to Run Docker Service Engine in Microsoft Windows’ in this link. If it is necessary, update the version of the Docker Desktop application. Read an article for updating it in the article titled ‘How to Update Docker Desktop in Microsoft Windows’ in this link. If Docker Desktop application is not available yet, just install it in the device. Check for a further reference to do it in an article titled ‘How to Install Docker Desktop in Microsoft Windows’ in this link. As for running Docker service engine, just take a look in the following video :
How to Run Local Docker Repository in Microsoft Windows
In this part, the focus will be just to show steps for creating and running the local or private docker repository registry as follows :
-
First of all, since the process require several command execution, it will use command line interface. Just run command line interface as follows :
Microsoft Windows [Version 10.0.22000.1219] (c) Microsoft Corporation. All rights reserved. C:\Users\Personal>
-
In the early step, before getting in further, search the registry docker image in the first place. Look at the following video to get a grasp on how to be able to do that :
-
Following after, just execute a command for pulling registry docker image from the public docker image repository in the command line interface :
C:\Users\Personal>docker pull registry Using default tag: latest latest: Pulling from library/registry ca7dd9ec2225: Pull complete c41ae7ad2b39: Pull complete 1ed0fc8a6161: Pull complete 21df229223d2: Pull complete 626897ccab21: Pull complete Digest: sha256:ce14a6258f37702ff3cd92232a6f5b81ace542d9f1631966999e9f7c1ee6ddba Status: Downloaded newer image for registry:latest docker.io/library/registry:latest C:\Users\Personal>
For another info on how to do that, just look in the following video :
-
After successfully downloading registry docker image, just check it by executing the following command :
C:\Users\Personal>docker image list --all REPOSITORY TAG IMAGE ID CREATED SIZE testnginx latest 2f381efd4421 7 minutes ago 211MB nginx latest 3964ce7b8458 27 hours ago 142MB registry latest 81c944c2288b 4 weeks ago 24.1MB C:\Users\Personal>
-
Since the process for downloading registry docker image is finish and it is a success. Following after, just run and execute the registry docker image as follows :
C:\Users\Personal>docker run -d -p 5000:5000 -v C:/localhub/registry:/var/lib/registry --restart=always --name hub.local registry b0c5e028c40d5828ea2e64d808b32fdaf7b1de19238bdb6fa4b7bfd264142961 C:\Users\Personal>
As a reference for running the registry docker image, take a look in the following video :
-
Finally, after execute and run the registry docker image as a docker container, check it further using the following command :
C:\Users\Personal>docker container list --all CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES b0c5e028c40d registry "/entrypoint.sh /etc…" 9 seconds ago Up 9 seconds 0.0.0.0:5000->5000/tcp hub.local 2fa1231804ca testnginx:latest "/usr/sbin/nginx" 7 minutes ago Up 7 minutes 0.0.0.0:8383->80/tcp magical_bell d8fc06dd81a5 nginx:latest "/docker-entrypoint.…" 17 minutes ago Up 13 minutes 0.0.0.0:8181->80/tcp web1 C:\Users\Personal>
In the above output command, the process for executing docker image to run as a docker container is a success.
-
Last but not least, in order to prove that the registry docker container is actually running, try to access it. The simple way to do that is by using ‘curl’ in the Command Prompt. Type the following command in the Command Prompt :
Microsoft Windows [Version 10.0.22631.4037] (c) Microsoft Corporation. All rights reserved. C:\Users\Personal> curl -X GET http://localhost:5000/v2/_catalog {"repositories":[]} C:\Users\Personal>
As for another method to do that, try to use any available web browser. Type ‘localhost:5000/v2/_catalog’ in the URL address bar of the web browser. For more reference on how to do that, just take a look in the following video content :