You use docker-compose to manage the lifecycle of Harbor. This topic provides some useful commands. You must run the commands in the directory in which docker-compose.yml is located.
See the Docker Compose command-line reference for more information about docker-compose.
Stop Harbor
To stop Harbor, run the following command.
sudo docker-compose stopStopping nginx ... doneStopping harbor-portal ... doneStopping harbor-jobservice ... doneStopping harbor-core ... doneStopping registry ... doneStopping redis ... doneStopping registryctl ... doneStopping harbor-db ... doneStopping harbor-log ... done
Restart Harbor
To restart Harbor, run the following command.
sudo docker-compose startStarting log ... doneStarting registry ... doneStarting registryctl ... doneStarting postgresql ... doneStarting core ... doneStarting portal ... doneStarting redis ... doneStarting jobservice ... doneStarting proxy ... done
Reconfigure Harbor
To reconfigure Harbor, perform the following steps.
Stop Harbor.
sudo docker-compose down -v
Update
harbor.yml.vim harbor.yml
Run the
preparescript to populate the configuration.sudo ./prepare
To reconfigure Harbor to install Notary and Trivy, include all of the components in the
preparecommand.sudo ./prepare --with-notary --with-trivy
Re-create and start the Harbor instance.
sudo docker-compose up -d
Other Commands
Remove Harbor’s containers but keep all of the image data and Harbor’s database files in the file system:
sudo docker-compose down -v
Remove the Harbor database and image data before performing a clean re-installation:
rm -r /data/databaserm -r /data/registryrm -r /data/redis