Publish your Docker Image to Docker Hub

Create and publish your docker image on docker hub.

Here in this note, I will tell you to how to upload your custom image to dokcer hub and make it public. You can upload your custom images to docker hub. So other people can also use that image in their applications. Docker Hub is the world's easiest way to create, manage, and deliver your teams' container applications. You can find many images on docker hub for your application. Also you can upload your custom image on it.

Login to the docker hub.

First you need to login to the docker hub. Run the below command from your terminal to login.
docker login
It will ask you for enter usename and password.
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to to create one.
Username: imvishalvyas
Password: ************
Login Succeeded
We now successfully authenticated docker hub login. So now you can upload your images to the docker hub. So now we have to create our custom image so that we can upload it to the dockerhub.

Create custom docker image

I was searching image for kops, kubectl image for my pipeline somedays ago. But i couldn't found any matching image to my requirement. So I have created my custom image to use that tools included. I have make it to the public so other peoples also can use that image.


FROM alpine:3.10
MAINTAINER imvishalvyas
RUN apk --no-cache add ca-certificates \
  && apk --no-cache add --virtual build-dependencies curl \
  && curl -LO \
  && mv kops-linux-amd64 /usr/local/bin/kops \
  && curl -LO \
  && mv kubectl /usr/local/bin/kubectl \
  && chmod +x /usr/local/bin/kops /usr/local/bin/kubectl \
  && apk del --purge build-dependencies

ENTRYPOINT ["/usr/local/bin/kops"]
CMD ["--help"]

let's build it.

docker build -t kops:v1 .

Tag the docker image.

You should use your docker hub username in image tag. In my case it's imvishalvyas.
docker tag kops-kubectl:v1 imvishalvyas/kops-kubectl:v1

Upload it to docker hub.

In the previous step we already login to the docker hub account using command. Now we will push the image to the docker hub account.
docker push imvishalvyas/kops-kubectl:v1

As you can see now that image is published successfuly on the docker hub. Now you can use that image anytime you want and also you can share that image to your group to use that image.


Linux Guru

Welcome to my Linux blog! Hello Friends, I am Vishal Vyas. I am a DevOps engineer and expert in Linux and Cloud Computing. Also I am a Certified Kubernetes Administrator, I have a total 12 plus years of experience in the IT field and I have worked in various technologies. I write about Linux, AWS, DevOps and web Technologies, I have started this blog to share my technical knowledge with all, I am posting here what I learn from the latest web technologies and the likes.


  1. nice articles Mr. Vishal Vyash, keep it up and link your Linkedin Profile in the bottom of the blogs

Previous Post Next Post