Docker Registry Operations: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(5 intermediate revisions by the same user not shown)
Line 7: Line 7:


=Internal=
=Internal=
 
* [[Distribution_Registry#Overview|Distribution Registry]]
* [[Docker Operations#Subjects|Docker Operations]]
* [[Docker Operations#Subjects|Docker Operations]]


=Overview=
=Overview=


"[[Docker_Concepts#Docker_Registry_-_Exposing_the_Content_of_the_Local_Image_Registry_over_TCP|Docker Registry]]" in this context refers to the image published by Docker, which instantiates as [[Docker_Concepts#Exposing_the_Content_of_the_Local_Image_Registry_over_TCP_with_Docker_Registry|a container that exposes the content of the local registry over TCP]]. Note that by default the Docker Registry container starts with HTTP support only, so all other Docker servers that use it must be configured to allow it as an "insecure registry", with --insecure-registry as described [[/etc/sysconfig/docker#--insecure-registry|here]].
"[[Docker_Concepts#Docker_Registry_-_Exposing_the_Content_of_the_Local_Image_Registry_over_TCP|Docker Registry]]" in this context refers to the image published by Docker, which instantiates as [[Docker_Concepts#Exposing_the_Content_of_the_Local_Image_Registry_over_TCP_with_Docker_Registry|a container that exposes the content of the local registry over TCP]]. Note that by default the Docker Registry container starts with HTTP support only, so all other Docker servers that use it must be configured to allow it as an "insecure registry", with --insecure-registry as described [[Docker_Server_Configuration#--insecure-registry|here]].


=Start=
=Start=


  docker run -d -p 5000:5000 --restart=always --name registry registry:2
  docker run -d -p 5000:5000 --restart=always --name registry registry:2
Test it with:
<syntaxhighlight lang='bash'>
curl -v http://<''ip-address''>:5000/v2/
*  Trying 192.168.1.10...
* TCP_NODELAY set
* Connected to 192.168.1.10 (192.168.1.10) port 5000 (#0)
> GET /v2/ HTTP/1.1
> Host: 192.168.1.10:5000
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Length: 2
< Content-Type: application/json; charset=utf-8
< Docker-Distribution-Api-Version: registry/2.0
< X-Content-Type-Options: nosniff
< Date: Thu, 19 Apr 2018 23:35:25 GMT
<
</syntaxhighlight>


=Customize Storage Location=
=Customize Storage Location=
Line 23: Line 45:


  docker run ... -v /mnt/registry:/var/lib/registry ...
  docker run ... -v /mnt/registry:/var/lib/registry ...
docker run -d -p 5000:5000 --restart=always  -v /var/lib/registry:/var/lib/registry --name registry registry:2

Latest revision as of 19:20, 8 December 2023

External

Internal

Overview

"Docker Registry" in this context refers to the image published by Docker, which instantiates as a container that exposes the content of the local registry over TCP. Note that by default the Docker Registry container starts with HTTP support only, so all other Docker servers that use it must be configured to allow it as an "insecure registry", with --insecure-registry as described here.

Start

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

Test it with:

curl -v http://<''ip-address''>:5000/v2/

*   Trying 192.168.1.10...
* TCP_NODELAY set
* Connected to 192.168.1.10 (192.168.1.10) port 5000 (#0)
> GET /v2/ HTTP/1.1
> Host: 192.168.1.10:5000
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Length: 2
< Content-Type: application/json; charset=utf-8
< Docker-Distribution-Api-Version: registry/2.0
< X-Content-Type-Options: nosniff
< Date: Thu, 19 Apr 2018 23:35:25 GMT
<

Customize Storage Location

docker run ... -v <native-host-path>:<container-mount-point> ...
docker run ... -v /mnt/registry:/var/lib/registry ...
docker run -d -p 5000:5000 --restart=always  -v /var/lib/registry:/var/lib/registry --name registry registry:2