Docker Hub: pulling and pushing container images to a public respository

Docker Hub is the world's largest repository of container images with an array of content sources including container community developers, open source projects and independent software vendors (ISV) building and distributing their code in containers. Users get access to free public repositories for storing and sharing images or can choose subscription plan for private repos.

We start by creating an account:

Then, we login in Docker Hub:

We search for the required image (in our case, the phamdb image created by James Lamine):

Click on the image name to see more details:

Now, we are going to download the image. We first login in our account from the command line:

docker login

Second, we download the phamdb image created by James Lamine:

docker pull jglamine/phamdb

We will solve the warning we have received: "Image docker.io/jglamine/phamdb:latest uses outdated schema1 manifest format. Please upgrade to a schema2 image for better future compatibility".

From the above link, we can read: "One way to upgrade an image from image manifest version 2, schema 1 to schema 2 is to docker pull the image and then docker push the image with a current version of Docker. Doing so will automatically convert the image to use the latest image manifest specification".

We start by getting the ID of the image we just downloaded:

docker ps -a

Then, we tag the jglamine/phamdb image:

docker tag d4f0e6e9d45b fortunalab/phamdb:schema2

After tagging the image, we push it to our repository:

Before pushing, you might need to logout, then log in from the command line to your docker hub account.
docker push fortunalab/phamdb:schema2

The image is now stored in our DockeHub account:

We pull the image from our remote public repository to our local server:

docker pull fortunalab/phamdb:schema2

We see that we do not receive that warning anymore.

That's it.