How to deploy private registry in docker?

                    

// run docker contianer with image registry
docker run - d -p 5000:5000 --name registry registry: 2

// tag your image
docker image tag my-image localhost:5000/my-image

// push your image to the registry
docker push localhost:5000/my-image

// pull your image from the registry
docker pull localhost:5000/my-image

// pull your image from host IP e.g. 192.168.46.100
docker pull 192.168.56.100:5000/my-image