How do i create a localhost docker registry and push an image to it?



  • Docker documentation: https://docs.docker.com/registry/deploying/#run-a-local-registry

    Note: For demo and training this type of registry is fine, TLS must be used for production

    Create a registry.

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

    Tag an existing image.

    $ docker tag my-nginx localhost:5000/myimages/my-nginx
    

    Push an image to the registry.

    $ docker push localhost:5000/myimages/my-nginx                          
    The push refers to repository [localhost:5000/myimages/my-nginx]
    0c690c3cba25: Pushed 
    b7efe781401d: Pushed 
    c9c2a3696080: Pushed 
    7b4e562e58dc: Pushed 
    latest: digest: sha256:1a1a39bf63115611bc81510f8646bba0d18ed8fb7daf2532be5373c1f410e8e0 size: 1155
    

Log in to reply
 

© Lightnetics 2024