SadServers
  • Scenarios
  • Labs
    All Labs Linux & Bash Web Servers Databases Data Processing Docker Kubernetes CI/CD Infrastructure as Code Tooling / Applications
  • Dashboard
  • Solutions
    For Individuals For Businesses
  • Ranking
  • Newsletter
  • Documentation
    FAQ Support Pro Accounts Pro+ Accounts Business Accounts Gift API CLI/TUI Privacy Troubleshooting Interviews
  • Blog
  • Pricing
  • Gift
    Gift Purchase Gift Redeem
  • About
Log In - Sign Up
  1. Labs
  2. Harbor
  3. Cheatsheet

Guide

Concepts and learning path

Troubleshooting

Failure modes and fixes

Cheatsheet

Commands to keep handy

Harbor cheatsheet

Docker login, tag, push, pull

docker login harbor.example.com docker tag myapp:1.0 harbor.example.com/myproject/myapp:1.0 docker push harbor.example.com/myproject/myapp:1.0 docker pull harbor.example.com/myproject/myapp:1.0

Robot account (CI)

# UI: Project → Robot Accounts → create (push/pull scope) docker login harbor.example.com -u 'robot$myproject+ci' -p TOKEN docker push harbor.example.com/myproject/myapp:${GIT_SHA}

Helm OCI push

helm registry login harbor.example.com helm package ./mychart helm push mychart-0.1.0.tgz oci://harbor.example.com/myproject

Harbor API (curl)

# Health curl -sk https://harbor.example.com/api/v2.0/health # List projects (basic auth) curl -sk -u admin:PASSWORD https://harbor.example.com/api/v2.0/projects # Repository artifacts curl -sk -u admin:PASSWORD \ https://harbor.example.com/api/v2.0/projects/myproject/repositories

Compose / service checks

CommandDescription
cd harbor && docker compose psHarbor stack status
./install.sh --with-trivyInstall with scanner (installer)
docker compose logs coreCore API logs
docker compose logs registryRegistry (distribution) logs

Kubernetes imagePullSecrets

kubectl create secret docker-registry harbor-reg \ --docker-server=harbor.example.com \ --docker-username=robot$proj+pull \ --docker-password=TOKEN # In pod spec: imagePullSecrets: [{ name: harbor-reg }]

Admin tasks (UI or API)

TaskWhere
Garbage collectionAdministration → Clean up → GC
ReplicationAdministration → Replications
Scan allInterrogation Services → scan on push
Retention policyProject → Policy → Tag retention

Pro tips

  • Full image path includes project — registry/project/repo:tag
  • 401 on push → login expired, wrong robot scope, or not a project member
  • Disk not shrinking after deletes → run garbage collection
  • Pin tags in K8s — avoid silent latest drift
  • TLS issues → trust Harbor CA or use /etc/docker/certs.d/HOSTNAME/

Practice scenarios

Hands-on Harbor scenarios on live Linux VMs: harbor

SadServersSadServers

Real-world Linux and DevOps scenarios for hands-on learning and technical assessment.

Uptime Robot ratio (30 days)
Product
  • Scenarios
  • For Individuals
  • For Businesses
  • Pricing
Resources
  • FAQ
  • Blog
  • Newsletter
Company
  • About Us
  • Support
  • Privacy Policy
  • Terms of Service
  • Contact
Connect With Us
info@sadservers.com

Made in Canada 🇨🇦
Updated: 2026-06-13 16:06 UTC – 2d2950a