What is Docker Hub?
Docker Hub is the default public registry for Docker images.
Logging In
bash
1docker login
2# Enter username and passwordPushing Images
bash
1# Tag for Docker Hub
2docker tag myapp:latest username/myapp:latest
3
4# Push
5docker push username/myapp:latest
6
7# Push all tags
8docker push username/myapp --all-tagsPulling Images
bash
1# Pull from Docker Hub
2docker pull username/myapp:latest
3
4# Pull official image
5docker pull nginx:latestOrganizations
bash
1# Push to organization
2docker push myorg/myapp:latestAutomated Builds
Connect GitHub/GitLab to Docker Hub for automatic builds on push.
Private Repositories
Docker Hub offers private repos:
- Free: 1 private repo
- Pro: Unlimited private repos
Other Registries
- GitHub Container Registry (ghcr.io)
- AWS ECR
- Google Container Registry
- Azure Container Registry
