Docker Registry

Docker Registry

Spring Application Deployed with Kubernetes

Step by step building an application using Spring Boot and deployed via Docker on Kubernetes with Helm

full course
  1. Setup: IDE and New Project
  2. Create the Data Repository
  3. Building a Service Layer
  4. Create a REST Controller
  5. Logging, Tracing and Error Handling
  6. Documentation and Code Coverage
  7. Database as a Service
  8. Containerize the Service With Docker
  9. Docker Registry
  10. Automated Build Pipeline
  11. Helm for Deployment
  12. Setting up a Kubernetes Cluster
  13. Automating Deployment (for CICD)
  14. System Design
  15. Messaging and Event Driven Design
  16. Web UI with React
  17. Containerizing our UI
  18. UI Build Pipeline
  19. Put the UI in to Helm
  20. Creating an Ingress in Kubernetes
  21. Simplify Deployment
  22. Conclusion and Review

In the previous article we created a docker image as part of our build process and stored it into our local repository. In order to deploy it in an automated fashion we should create a remote image repository in the cloud. This will expand the types of tools that we can use as well as allow for a gitops workflow that will automatically deploy our application when code is released into the master branch.

Remote Docker Registry

Create a Docker Registry

There are plenty of cloud based docker registries. ECR is a very good choice but the free tier only allows for 500MB of storage. Each of our images is going to be around 100MB and each release is going to generate an image, so we would only need a few services with a few versions before we started running out of space.

We’re going to use codefresh for the docker repository. Go ahead and create an account at codefresh. Codefresh gives you a docker repository on creation. Lets get the details. Go to Account Settings, under Integrations select docker registry. Hit the pencil on the default registry (mine is cfcr) and click on generate token. At the bottom here under codefresh registry generate a new token. Call it local and hit the create button. Save this token somewhere and click the copy docker login command to clipboard to generate a login command we’re going to use to access this registry.

Pushing our Image Up

paste the contents of the clipboard into your CLI. It should look something like this:

docker login r.cfcr.io -u brianrook -p da3***

Lets tag the build we just made with the version number. We’re cloning our image into one that matches the remote repository name and adding the tag. Make sure to replace the ${account} with the account name you created when you registered.

docker tag medium/medium-customer:latest r.cfcr.io/${account}/medium-customer:0.0.1-SNAPSHOT

and confirm that we have tagged it successfully

docker image list
REPOSITORY                  TAG                 IMAGE ID            CREATED             SIZE
r.cfcr.io/docketdynamics/medium-customer   0.0.1-SNAPSHOT      7f9b379551d8        50 years ago        260MB
medium/medium-customer                                latest              7f9b379551d8        50 years ago        260MB

Now lets push the tagged version up to the remote registry

docker push r.cfcr.io/${account}/medium-customer:0.0.1-SNAPSHOT

and confirm that it made its way into our remote repo

docker pull r.cfcr.io/docketdynamics/medium-customer:0.0.1-SNAPSHOT
0.0.1-SNAPSHOT: Pulling from docketdynamics/medium-customer
Digest: sha256:25bdbfe086162e262607fc800db458400c2d1bf4f9b9bf11e7c6c48cb75c8c2e
Status: Image is up to date for r.cfcr.io/docketdynamics/medium-customer:0.0.1-SNAPSHOT
r.cfcr.io/docketdynamics/medium-customer:0.0.1-SNAPSHOT

0 comments on “Docker RegistryAdd yours →

Leave a Reply

Your email address will not be published. Required fields are marked *