┌─────────────────────────────────────────────────────────┐
│ Docker Hub (Public) │
│ ├── https://hub.docker.com │
│ ├── Δωρεάν public images │
│ ├── Rate limits: 100 pulls/6h (anonymous) │
│ │ 200 pulls/6h (free account) │
│ ├── 1 private repo (free plan) │
│ └── Κατάλληλο για: public projects, base images │
├─────────────────────────────────────────────────────────┤
│ Private Registry │
│ ├── Self-hosted ή cloud-based │
│ ├── Απεριόριστα private images │
│ ├── Κανένα rate limit │
│ ├── Πλήρης έλεγχος │
│ └── Κατάλληλο για: production, proprietary code │
└─────────────────────────────────────────────────────────┘
┌──────────────────┬──────────────┬─────────────────────────┐
│ Registry │ Τύπος │ Χαρακτηριστικά │
├──────────────────┼──────────────┼─────────────────────────┤
│ Docker Registry │ Self-hosted │ Απλό, ελαφρύ, δωρεάν │
│ (registry:2) │ │ Βασική λειτουργία │
├──────────────────┼──────────────┼─────────────────────────┤
│ Harbor │ Self-hosted │ Enterprise features │
│ │ │ Security scanning │
│ │ │ Role-based access │
├──────────────────┼──────────────┼─────────────────────────┤
│ GitLab Registry │ Self-hosted │ Integrated με GitLab │
│ │ ή Cloud │ CI/CD integration │
├──────────────────┼──────────────┼─────────────────────────┤
│ GitHub Packages │ Cloud │ Integrated με GitHub │
│ │ │ ghcr.io │
├──────────────────┼──────────────┼─────────────────────────┤
│ AWS ECR │ Cloud │ AWS integration │
│ │ │ IAM authentication │
├──────────────────┼──────────────┼─────────────────────────┤
│ Azure ACR │ Cloud │ Azure integration │
│ GCP Artifact │ Cloud │ GCP integration │
└──────────────────┴──────────────┴─────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ Docker Image Naming Convention: │
│ │
│ registry/namespace/image:tag │
│ │ │ │ │ │
│ │ │ │ └── έκδοση (latest, 1.0.0) │
│ │ │ └─────── όνομα image │
│ │ └─────────────── username ή org │
│ └───────────────────────── registry URL │
│ │
│ Παραδείγματα: │
│ docker.io/library/nginx:latest ← Docker Hub │
│ docker.io/myuser/myapp:1.0.0 ← Docker Hub │
│ registry.example.com/myapp:1.0.0 ← Private │
│ ghcr.io/myorg/myapp:latest ← GitHub │
│ 123456.dkr.ecr.eu-west-1.amazonaws.com/myapp ← AWS ECR │
└─────────────────────────────────────────────────────────┘
❌ Χωρίς private registry:
myapp:latest ← περιέχει proprietary code
→ Docker Hub (public) = ορατό σε όλους!
✅ Με private registry:
registry.mycompany.com/myapp:latest
→ Μόνο authorized users έχουν πρόσβαση!
❌ Χωρίς private registry:
10 servers × pull από Docker Hub
→ Rate limits, slow downloads, internet dependency
✅ Με private registry (local):
10 servers × pull από 192.168.1.100:5000
→ Γρήγορο, local network, χωρίς limits!
Developer push code
│
▼
CI/CD build image
│
▼
Push → registry.company.com/myapp:2.0.0
│
▼
Ansible pull → deploy στους servers
│
▼
Servers pull από local registry (γρήγορο!) ✅
Docker Registry v2 αποθηκεύει images σε:
├── Local filesystem (default)
│ └── /var/lib/registry/
│
├── Amazon S3
│ └── s3://mybucket/registry/
│
├── Google Cloud Storage
│ └── gs://mybucket/registry/
│
├── Azure Blob Storage
│ └── azure://mycontainer/
│
└── OpenStack Swift
└── swift://mycontainer/
┌─────────────────────────────────────────────────────────┐
│ │
│ 1. BUILD │
│ docker build -t myapp:1.0.0 . │
│ │ │
│ 2. TAG │
│ docker tag myapp:1.0.0 │
│ registry.example.com/myapp:1.0.0 │
│ │ │
│ 3. PUSH │
│ docker push registry.example.com/myapp:1.0.0 │
│ │ │
│ 4. PULL (σε production servers) │
│ docker pull registry.example.com/myapp:1.0.0 │
│ │ │
│ 5. RUN │
│ docker run registry.example.com/myapp:1.0.0 │
│ │
└─────────────────────────────────────────────────────────┘
Private Registry
├── Γιατί:
│ ├── Ασφάλεια → private images
│ ├── Performance → local network
│ └── CI/CD → build → push → deploy
│
├── Επιλογές:
│ ├── registry:2 → simple, self-hosted ✅
│ ├── Harbor → enterprise features
│ ├── GitLab/GitHub → cloud integrated
│ └── AWS/Azure/GCP → cloud managed
│
├── Naming: registry/namespace/image:tag
│
└── Lifecycle:
build → tag → push → pull → run