DEV Community

Cover image for Push a Docker Image to Docker Hub
Oluwatobiloba Akinbobola
Oluwatobiloba Akinbobola

Posted on

Push a Docker Image to Docker Hub

INTRODUCTION

Pushing a Docker image to Docker Hub is a straightforward process that allows you to share and deploy your containerized applications. Follow these steps:

1.Log in to Docker Hub:
Use the command docker login and enter your Docker Hub credentials when prompted.
Log in

docker login
Enter fullscreen mode Exit fullscreen mode

2.Tag Your Image:
Tag your local image with your Docker Hub username and repository name.

docker tag <local-image-name> <docker-hub-username>/<repository-name>:<tag>
Enter fullscreen mode Exit fullscreen mode

Create repository
Example:

docker tag fastfood brookeycutie/profusion:v1
Enter fullscreen mode Exit fullscreen mode

3.Push the Image:
Push the tagged image to Docker Hub using the docker push command.

docker push <docker-hub-username>/<repository-name>:<tag>
Enter fullscreen mode Exit fullscreen mode

Image description
Example:

docker push brookeycutie/profusion:v1
Enter fullscreen mode Exit fullscreen mode

Image description

4.Verify on Docker Hub:
Log in to your Docker Hub account and check the repository to confirm the image has been uploaded.
Verify on Docker Hub

By following these steps, you can easily share your Docker images with others or deploy them across different environments.

Top comments (0)