(C# ASP.NET Core) How to Publish a Docker Image to DockerHub Registry with Visual Studio

This is a walkthrough on uploading a docker image to the docker hub registry. We shall upload the same hellodocker project and then verify the uploaded image by visiting the docker hub portal.
(Rev. 04-Jun-2024)

Categories | About |     |  


Step 1 - Create your Docker Account

DockerHub is a repository of docker images, just like Github is for source code. A developer can publish a docker image to this registry so that other developers can pull it and examine it. Developer teams often use these images for collaboration on a project. Infact, cloud providers like Amazon and Azure can use these images to deploy the projects to public domains and hostings.

It is located at hub.docker.com.

First of all visit the website docker.com and create an account for yourself. Take note of your login id and password. The same login ID and password will be used through visual studio at the time of uploading and publishing your docker image.

Video Explanation

Please watch the following youtube video:

Step 2 - Open the Project

In this walkthrough we shall upload the same hellodocker project that we have been working so far.

So open the project in visual studio and right click it to open the context menu.

Select the option Publish and click it to open this publishing dialog. You will see various publish options. Select Docker Container Registry and click next.

Select Docker Hub.

You can notice that there are other docker registry options as well. We shall select Docker Hub for our current task. So click next.

Enter your user name and password, and click Finish.

A publish profile window opens. It has many options most of which can be left as such. But one option is worth discussion now - the tag option.

A tag can be set for your image. It is an additional identifier that can be attached to the name of your image. The default tag is called latest. Right now we will not be attaching a tag, so keep the tag as latest.

Click the publish button. Allow the process to complete.

It takes a long time to complete the process, depending on the speed of your internet.

Step 3 - Visit hub.docker and Verify

Next, let us open the hub.docker portal and login into it.

If everything was done correctly, then you should see the image on your docker page.

This is how a docker image can be uploaded and published with visual studio. Thanks!

This Blog Post/Article "(C# ASP.NET Core) How to Publish a Docker Image to DockerHub Registry with Visual Studio" by Parveen is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.