Is the interpretation of the below command correct?
My Interpretation: Create a registry with name "registry" that listens on port 5002 of container which is mapped to port 5001 of host .
Also, I do not understand what the "registry:2" is required for? Looks like it is "repository_name:tag" which is equivalent to image name. Is this correct?
docker run -d -p 5001:5002 --restart=always --name registry registry:2
Also, I tried using "registry:1" and "registry:3" which did not work. It works only when I use "registry:2".
✘ ~ docker run -d -p 5001:5002 --restart=always --name new_registry registry:3
Unable to find image 'registry:3' locally
Pulling repository docker.io/library/registry
Tag 3 not found in repository docker.io/library/registry
✘ ~ docker run -d -p 5001:5002 --restart=always --name new_registry registry:1
Unable to find image 'registry:1' locally
Pulling repository docker.io/library/registry
Tag 1 not found in repository docker.io/library/registry
As mentioned in the official registry image
The Deploying a registry server page uses the new registry server (with a simpler mapping):
docker run -d -p 5000:5000 --restart=always --name registry registry:2
This is for localhost access only, since accessing it from other hosts would necessitate ssl certificates.
docker run -d -p 5000:5000 --restart=always --name registry \
-v `pwd`/certs:/certs \
-e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt \
-e REGISTRY_HTTP_TLS_KEY=/certs/domain.key \
registry:2
The OP Zack adds in the comments:
It seems that it does not work for tags = 3
That is because the official page only list the following tags:
2, 2.2, 2.2.0 (Dockerfile)
There is no tag 3.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments