O'Reilly logo

Learning Docker by Vinod Singh, Jeeva S. Chelladhurai, Pethuru Raj

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Pushing images to the Docker Hub

Here, we will create a Docker image on the local machine, and push this image to the Docker Hub. You need to perform the following steps in this section:

  1. Create a Docker image on the local machine by doing one of the following:
    • Using the docker commit sub command
    • Using the docker commit sub command with Dockerfile
  2. Push this created image to the Docker Hub.
  3. Delete the image from the Docker Hub.

We will use the Ubuntu base image, run the container, add a new directory and a new file, and then create a new image. In Chapter 3, Building Images, we have seen the creation of the Docker image using Dockerfile. You may refer to this to check for details of the Dockerfile syntax.

We will run the container with the name containerforhub ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required