DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Scaling Microservices With Docker and Kubernetes on Production
  • Docker Model Runner: Streamlining AI Deployment for Developers
  • A Guide to Container Runtimes
  • Gemma 3: Unlocking GenAI Potential Using Docker Model Runner

Trending

  • Non-Project Backlog Management for Software Engineering Teams
  • Role of Cloud Architecture in Conversational AI
  • Building AI-Driven Intelligent Applications: A Hands-On Development Guide for Integrating GenAI Into Your Applications
  • Article Moderation: Your Questions, Answered
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Create Your Own Private Docker Registry

Create Your Own Private Docker Registry

By 
Robert Greathouse user avatar
Robert Greathouse
·
Aug. 11, 14 · Interview
Likes (1)
Comment
Save
Tweet
Share
18.5K Views

Join the DZone community and get the full member experience.

Join For Free

This is a post in a series discussing using spring-boot and docker for deployment. Refer to the end of the first post for a table of contents.

Shortly after you start building docker containers you will realize that you need some place to publish your images. You could push to the central docker registry. However, the central registry is public. Not a great idea if you are working on a private project.

If this is your case, you can simply run a local docker registry. To install and run your private registry run $ docker run -p 5000:5000 -d registry

Surprise!!! It is ran in a docker container.

You can now start pushing to your local repository. As an example, I will pull the latest postgres image and push version 9.4 to my local registry.

$ docker pull postgres
$ docker tag postgres:9.4 localhost:5000/postgres:9.4
$ docker push localhost:5000/postgres

Outputs:

The push refers to a repository [localhost:5000/postgres] (len: 1)
Sending image list
Pushing repository localhost:5000/postgres (1 tags)
511136ea3c5a: Image successfully pushed
ec3443b7b068: Image successfully pushed
06af7ad6cff1: Image successfully pushed
37eae31ff4e9: Image successfully pushed
83e30bf01299: Image successfully pushed
499da968a652: Image successfully pushed
bf09bd07d760: Image successfully pushed
1eee820e762b: Image successfully pushed
7bf9287ccfce: Image successfully pushed
288b8d534217: Image successfully pushed
f20dbf0acb45: Image successfully pushed
bd511e81a5ed: Image successfully pushed
8fe7eb38aea1: Image successfully pushed
464263a50f65: Image successfully pushed
1f58a67adecd: Image successfully pushed
a99fb4ee814d: Image successfully pushed
6112f975feab: Image successfully pushed
6dff1b5c2259: Image successfully pushed
Pushing tag for rev [6dff1b5c2259] on {http://localhost:5000/v1/repositories/postgres/tags/9.4}

Looking at the current images, you will notice that the version tagged with localhost and the official images have the same information.

Notice that I had to retag the image with the location of the repository. I thought the requirement to put the location address as part of the image name was a little odd. However, after using docker longer, it makes sense. It ensures you know where the image was originally pulled.

$ docker images
postgres                  9.4                 6dff1b5c2259        5 days ago          244.4 MB
localhost:5000/postgres   9.4                 6dff1b5c2259        5 days ago          244.4 MB

Since docker tags are not permanent, and newer version of the postgres:9.4 image could be pushed to the public registry. When you self-host images, you are in control of when updates are pushed to any base image that you have extended. Someday I intend to learn how to build an image completely from scratch.

Docker-ize All the Things!

 

Docker (software)

Opinions expressed by DZone contributors are their own.

Related

  • Scaling Microservices With Docker and Kubernetes on Production
  • Docker Model Runner: Streamlining AI Deployment for Developers
  • A Guide to Container Runtimes
  • Gemma 3: Unlocking GenAI Potential Using Docker Model Runner

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!