How to interpret this docker registry creation command?

Is the interpretation of the command below correct?

My Interpretation: create a registry called "registry" that listens on port 5002 of the container, which maps to host port 5001.

In addition, I do not understand what "registry: 2" is for? It looks like a "repository_name: tag", which is equivalent to the image name. Is it correct?

docker run -d -p 5001:5002 --restart=always --name registry registry:2

In addition, I tried using "registry: 1" and "registry: 3", which did not work. It only works 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
+4
source share
1 answer

  • >= 2 .
  • .

( ):

docker run -d -p 5000:5000 --restart=always --name registry registry:2

, ssl.

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

OP Zack :

, = 3

, Dockerfile)

3.

+1

Source: https://habr.com/ru/post/1615903/


All Articles