List of Topics:
Location Research Breakthrough Possible @S-Logix pro@slogix.in

Office Address

Social List

How to Create a Own Private Docker Registry and Push/Pull Images?

Docker

Condition for Create a Own Private Docker Registry and Push/Pull Images

  • Description:
    This task demonstrate how to set up a private Docker registry on your local machine, similar to hosting your own Docker Hub. You will tag an image, push it to your private registry, and then pull it back to verify successful storage and retrieval.A private registry is useful in organizations where internet access is restricted or when container images need to be stored securely within the company network.

Steps

  •  STEP 1 — Run a Private Docker Registry
     Description: Start a local registry container listening on port 5000.
     Command:
    docker run -d -p 5000:5000 --name registry registry:2
                
  •  STEP 2 — Tag an Image for the Private Registry
     Description: Tag an existing Docker image to point to your local registry.
     Command:
    docker tag hello-docker localhost:5000/hello-docker
                
     ✔ This prepares hello-docker for pushing to the private registry.
  •  STEP 3 — Push the Image to the Private Registry
     Description: Upload the tagged image to your local registry.
     Command:
    docker push localhost:5000/hello-docker
                
    ✔ This uploads hello-docker to your private repository running on port 5000.
  •  STEP 4 — Pull the Image from the Private Registry
     Description: Retrieve the image from the local registry to confirm it’s stored correctly.
     Command:
    docker pull localhost:5000/hello-docker
                
  •  Verification Steps
     Step 1 — Check Registry Container is Running
     Command:
    docker ps
                
    ✔ You should see: registry:2 Up ...
     Step 2 — Check Stored Image in the Registry
     Command:
    curl http://localhost:5000/v2/_catalog
                
     Expected output: {"repositories":["hello-docker"]}
     Step 3 — Remove Local Image and Pull Again to Verify
     Commands:
    docker rmi localhost:5000/hello-docker
    docker pull localhost:5000/hello-docker
                
    ✔ If the pull succeeds, your registry works!
     Step 4 — Try Running the Pulled Image
     Command:
    docker run localhost:5000/hello-docker
                
  •  Outcome
    ✔ A functioning local Docker registry.
    ✔ Ability to push and pull images locally.
    ✔ Understand how organizations host private registries instead of relying on Docker Hub.
Screenshots
  • 410
  • 411
  • 412
  • 413
  • 414
  • 415
  • 416
  • 417
  • 418