Docker Hub

Introduction To Docker Hub

Docker Hub is a cloud-based registry service which allows you to link to code repositories, build your images and test them, stores manually pushed images, and links to Docker Cloud so you can deploy images to your hosts. It provides a centralized resource for container image discovery, distribution and change management, user and team collaboration, and workflow automation throughout the development pipeline.

Login to your Docker Hub with your unique Docker Id :


Docker Hub provides the following major features:

Image Repositories: It helps you in finding and pulling images from community and official libraries, and manage, push to, and pull from private image libraries to which you have access.

Automated Builds: Automatically create new images when you make changes to a source code repository.

Organizations: Create work groups to manage access to image repositories.

Create a Docker ID

Your Docker ID gives you one private Docker Hub repository for free. If you need more private repositories, you can upgrade from your free account to a paid plan.

Explore Repositories
You can find public repositories and images from Docker Hub in two ways. You can “Search” from the Docker Hub website, or you can use the Docker command line tool to run the docker search command. For example if you were looking for an mongodb image, you might run the following command line search:

$ docker search shivamverma/mongodb

The expected output is :



Both methods list the available public repositories on Docker Hub which match the search term.

Official Repositories

Docker Hub contains a number of Official Repositories. These Official repositories are public, certified repositories from vendors and contributors to Docker. They contain Docker images from vendors like Oracle, Microsoft, Ubuntu and Red Hat that you can use as the basis to building your applications and services.

Searching for a Docker Image
Assuming you are logged in with your Account (Search actually works without an account too!) — try searching for any images via the Web Search box as shown below:


For e.g. type in busybox and see the list of repositories that are returned.

The screenshot below is the first repository that was listed:


Notice the stars and the downloads. It gives you a good idea of its popularity.

Pulling an Image

Now that you are familiar with IMAGES and their TAGS, it should be clear to you that those are the only two pieces of information that you need to pull down an image locally to your step.

You can do that via the docker pull command as shown below:

$ docker pull busybox

or

$ docker pull busybox:latest

or

$ docker pull shivamverma/busybox

and so on.

Viewing a list of images

You can check out the list of images that you have locally via the docker images command:

$ docker images

Understand the output. It will have REPOSITORY and the TAG in the output result.

Launching a Container

Now that you have a local image, you can launch a container via :

$ docker run <Image_Name>:<TAG>

Comments

Post a Comment

Popular posts from this blog

Docker Commands

Docker Commands Continue...