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
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
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

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • Automated Testing Lifecycle
  • Docker and Kubernetes Transforming Modern Deployment
  • Using Open Source for Data Integration and Automated Synchronizations
  • Mastering Node.js: The Ultimate Guide

Trending

  • Software Verification and Validation With Simple Examples
  • Build a Serverless App Fast With Zipper: Write TypeScript, Offload Everything Else
  • Best Practices for Writing Clean Java Code
  • The Convergence of Testing and Observability
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Create Your Own Private Docker Registry

Create Your Own Private Docker Registry

Robert Greathouse user avatar by
Robert Greathouse
·
Aug. 11, 14 · Interview
Like (1)
Save
Tweet
Share
17.79K 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

  • Automated Testing Lifecycle
  • Docker and Kubernetes Transforming Modern Deployment
  • Using Open Source for Data Integration and Automated Synchronizations
  • Mastering Node.js: The Ultimate Guide

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • 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: