How to install an Enterprise Docker registry on Photon OS with Harbor

So you have been using Docker for some time now and you want to get serious and start storing your images locally. With this guide I will show you how to install and configure VMware Harbor, an open source enterprise class Docker Registry.

screen-shot-2016-10-05-at-11-27-24-am

Features of Harbor Registry

  • Role based access control: Users and repositories are organized via ‘projects’ and a user can have different permission for images under a project.
  • Image replication: Images can be replicated (synchronized) between multiple registry instances. Great for load balancing, high availability, hybrid and multi-cloud scenarios.
  • Graphical user portal: User can easily browse, search repositories and manage projects.
  • AD/LDAP support: Harbor integrates with existing enterprise AD/LDAP for user authentication and management.
  • Auditing: All the operations to the repositories are tracked.
  • Internationalization: Already localized for English, Chinese, German, Japanese and Russian. More languages can be added.
  • RESTful API: RESTful APIs for most administrative operations, easy to integrate with external systems.
  • Easy deployment: docker compose and offline installer.

Pre-Reqs

  • Photon OS 1.0 Full install with at least 1 vCPU 4GB RAM and 10GB storage – vSphere OVA Here
  • Internet Access from Photon OS to the internet
  • A quite place where you will not get interrupted see my guide here

First let’s install Harbor, SSH into the Registry Server you created with Photon OS and start Docker with the following

systemctl start docker

Now type the following to enable Docker at bootup

systemctl enable docker

Now let’s install git by typing the following

tdnf install git

type y and press enter to confirm the installation

Now let’s install the latest release of Docker Compose with the following command

curl -L https://github.com/docker/compose/releases/download/1.7.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose

Now let’s make the Docker Compose files executable by typing the following

chmod +x /usr/local/bin/docker-compose

Now change to the /var/opt directory

screen-shot-2016-10-05-at-11-21-05-am
cd /var/opt

No we are ready to install Harbor, type the following to clone the repo from Github

screen-shot-2016-10-05-at-11-22-40-am

Now change to harbor/Deploy

 screen-shot-2016-10-05-at-11-23-07-am
cd harbor/Deploy

Now edit harbor.cfg with the vi editor

screen-shot-2016-10-05-at-11-24-47-am
vi harbor.cfg

Now click i and edit the hostname to match your servers ip address or hostname, you can also edit the mail settings and default password if you wish.

When your done hit esc key then hold Shift and click ZZ to save the file

screen-shot-2016-10-05-at-11-24-47-am

Now let’s prepare the config files for harbor with the following command

screen-shot-2016-10-05-at-11-25-02-am
./prepare

Now let’s start Harbor with the following Docker Compose command

NOTE: It will take several minutes for the operation to complete

screen-shot-2016-10-05-at-11-26-02-am
docker-compose up -d

If everything went without errors you should be able to open a new browser to you registry server ip or hostname example http://reg.corp.local

screen-shot-2016-10-05-at-11-37-17-am

Enjoy your new Registry complements of VMware Harbor

Also, if you plan to store a large amount of images see this Guide from Cormac Hogan on using Harbor with the vSphere Volume Driver and vSAN http://cormachogan.com/2016/07/29/using-vsphere-docker-volume-driver-run-project-harbor-vsan/

Remember sharing is caring!

11 Replies to “How to install an Enterprise Docker registry on Photon OS with Harbor”

  1. Pingback: Testing Harbor Registry with PhotonOS – VMtoCloud.com

  2. Pingback: Using vSphere docker volume driver to run Project Harbor on VSAN - CormacHogan.com

  3. Pingback: How to use PhotonOS with an insecure registry – VMtoCloud.com

  4. Pingback: Using vSphere docker volume driver to run Project Harbor on VSAN - Code @ VMware

  5. Pingback: Containers for the vSphere Admin – VMtoCloud.com

  6. Pingback: Hybrid cloud Docker Registry with VMware Harbor – VMtoCloud.com

  7. Pingback: Remote site replicated Docker Registries with VMware Harbor – VMtoCloud.com

  8. Pingback: How to use VMware Admiral Container Service with Harbor Registry – VMtoCloud.com

  9. Pingback: How to use vSphere Integrated Containers with Admiral and Harbor – VMtoCloud.com

  10. Pingback: Containers for the vSphere Admin | pcguide.vn

  11. No /Deploy directory only a make directory where harbor.cfg is located
    no yaml file to start docker-compose after modify harbor.cfg and running ./prepare

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.