harbor/docs/harbor-doc-reorg/install_config/configuration/reconfigure_manage_lifecycle.md
2019-12-13 13:16:18 +01:00

2.0 KiB

Reconfigure Harbor and Manage the Harbor Lifecycle

You can use docker-compose to manage the lifecycle of Harbor. Some useful commands are listed below. You must run the commands in the same directory as docker-compose.yml.

Stop Harbor:

$ sudo docker-compose stop
Stopping nginx              ... done
Stopping harbor-portal      ... done
Stopping harbor-jobservice  ... done
Stopping harbor-core        ... done
Stopping registry           ... done
Stopping redis              ... done
Stopping registryctl        ... done
Stopping harbor-db          ... done
Stopping harbor-log         ... done

Restart Harbor after Stopping:

$ sudo docker-compose start
Starting log         ... done
Starting registry    ... done
Starting registryctl ... done
Starting postgresql  ... done
Starting core        ... done
Starting portal      ... done
Starting redis       ... done
Starting jobservice  ... done
Starting proxy       ... done

Reconfigure Harbor

To reconfigure Harbor, stop the existing Harbor instance and update harbor.yml. Then run prepare script to populate the configuration. Finally re-create and start the Harbor instance.

$ sudo docker-compose down -v
$ vim harbor.yml
$ sudo prepare
$ sudo docker-compose up -d

Other Commands

Remove Harbor's containers while keeping the image data and Harbor's database files on the file system:

$ sudo docker-compose down -v

Remove Harbor's database and image data for a clean re-installation:

$ rm -r /data/database
$ rm -r /data/registry

Managing the Harbor Lifecycle with Notary, Clair and Chart Repository Service

If you want to install Notary, Clair and chart repository service together, you should include all the components in the prepare commands:

$ sudo docker-compose down -v
$ vim harbor.yml
$ sudo prepare --with-notary --with-clair --with-chartmuseum
$ sudo docker-compose up -d

Please check the Docker Compose command-line reference for more on docker-compose.