Understanding Docker Hub and Uploading Images
Simple guide explaining what Docker Hub is and how to upload your own Docker images to it.
π³ Docker Hub and Uploading Images
Docker Hub is the official cloud-based registry where Docker users can store, share, and manage images publicly or privately. It allows developers to upload their Docker images and pull them from anywhere in the world.
You can think of it like GitHub for Docker images β instead of pushing code, you push container images.
π What is Docker Hub
- Docker Hub is a central repository for Docker images.
- You can pull images to use (like
nginx,mysql,ubuntu, etc.) or push your own custom images. - It helps in team collaboration, version control, and easy deployment of containerized applications.
Examples:
- Public image β anyone can download (like
nginx:latest) - Private image β only you or your organization can access
βοΈ Step 1: Create a Docker Hub Account
- Go to https://hub.docker.com
- Click Sign Up and create a free account.
- After registration, log in to Docker Hub.
π§© Step 2: Log in to Docker from Terminal
Use your Docker Hub credentials to log in from your local machine:
docker loginIt will ask for your Docker ID and password. If login is successful, youβll see:
Login SucceededποΈ Step 3: Tag Your Local Docker Image
Before pushing your image to Docker Hub, tag it properly with your Docker Hub username and repository name.
Example:
docker tag myapp:latest your-dockerhub-username/myapp:1.0Explanation:
myapp:latestβ your local image name.your-dockerhub-username/myapp:1.0β repository name with tag version.
The image must include your Docker Hub username before pushing.
βοΈ Step 4: Push Image to Docker Hub
Now upload your image to Docker Hub:
docker push your-dockerhub-username/myapp:1.0Docker will upload all layers of the image. Once completed, youβll see it available in your Docker Hub account under Repositories.
π Step 5: Verify Image on Docker Hub
- Log in to hub.docker.com
- Go to Repositories
- Youβll see your uploaded image listed (e.g.,
myappwith tag1.0).
Now anyone (or you) can pull it using:
docker pull your-dockerhub-username/myapp:1.0π§Ή Step 6: Manage Docker Images
You can push new versions of the same image with different tags:
docker tag myapp:latest your-dockerhub-username/myapp:2.0
docker push your-dockerhub-username/myapp:2.0You can also delete old images directly from the Docker Hub web interface.