Docker Hub Quickstart
Tags: docker
Published: 2020-01-09 13:49:45

This article is referred from **[Docker Hub Quickstart](https://docs.docker.com/docker-hub/)**

[Docker Hub](https://hub.docker.com/) is a service provided by Docker for finding and sharing container images with your team. It provides the following major features:

[Repositories](https://docs.docker.com/docker-hub/repos/): Push and pull container images.
[Teams & Organizations](https://docs.docker.com/docker-hub/orgs/): Manage access to private repositories of container images.
[Official Images](https://docs.docker.com/docker-hub/official_images/): Pull and use high-quality container images provided by Docker.
[Publisher Images](https://docs.docker.com/docker-hub/publish/customer_faq/): Pull and use high- quality container images provided by external vendors. Certified images also include support and guarantee compatibility with Docker Enterprise.
[Builds](https://docs.docker.com/docker-hub/builds/): Automatically build container images from GitHub and Bitbucket and push them to Docker Hub.
[Webhooks](https://docs.docker.com/docker-hub/webhooks/): Trigger actions after a successful push to a repository to integrate Docker Hub with other services.

**Step 1: Sign up for Docker Hub**

Start by [creating an account](https://hub.docker.com/signup).

**Step 2: Create your first repository**

To create a repo:

1. Sign in to Docker Hub.

2. Click on "Create a Repository" on the Docker Hub welcome page:

![Welcome](https://thepracticaldev.s3.amazonaws.com/i/ssbdm1ohw3pwmfi92iqm.PNG)

3. Name it `<your-username>/my-first-repo` as shown below. Select "Private":

![Create Repository](https://thepracticaldev.s3.amazonaws.com/i/0985z9xrxk6ptbm6uz9p.PNG)

You’ve created your first repo. You should see:

![Repository Created](https://thepracticaldev.s3.amazonaws.com/i/32dwqub5fqvpyff0pzo6.PNG)

**Step 3: Download and install Docker Desktop**

We’ll need to download Docker Desktop to build and push a container image to Docker Hub.

Download and install [Docker Desktop](https://docker.com/get-started). If on Linux, download [Docker Engine - Community](https://hub.docker.com/search?type=edition&offering=community).

Open the terminal and sign in to Docker Hub on your computer by running `docker login`

**Step 4: Build and push a container image to Docker Hub from your computer**

1. Start by creating a [Dockerfile](https://docs.docker.com/engine/reference/builder/) to specify your application as shown below:

    cat > Dockerfile <<EOF
    FROM busybox
    CMD echo "Hello world! This is my first Docker image."
    EOF

2. Run `docker build -t <your_username>/my-first-repo .` to build your Docker image.

3. Test your docker image locally by running `docker run <your_username>/my-first-repo`

4. Run `docker push <your_username>/my-first-repo` to push your Docker image to Docker Hub.

You should see output similar to:

![Terminal](https://thepracticaldev.s3.amazonaws.com/i/szu0x47c95qrv2daouhe.PNG)

And in Docker Hub, your repository should have a new `latest` tag available under Tags:

![Tag Created](https://thepracticaldev.s3.amazonaws.com/i/8xt2c3yt5g4nirutnfq6.PNG)

**Congratulations! You’ve successfully:**
Signed up for Docker Hub
Created your first repository
Built a Docker container image on your computer
Pushed it to Docker Hub

**Next steps**
Create an [organization](https://docs.docker.com/docker-hub/orgs/) to use Docker Hub with your team.
Automatically build container images from code through [builds](https://docs.docker.com/docker-hub/builds/).
[Explore](https://hub.docker.com/explore) official & publisher images.
[Upgrade your plan](https://docs.docker.com/docker-hub/upgrade/) to push additional private Docker images to Docker Hub.