title | weight |
---|---|
Reconfigure Harbor and Manage the Harbor Lifecycle |
55 |
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
.
To stop Harbor, run the following command.
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
To restart Harbor, run the following command.
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
To reconfigure Harbor, perform the following steps.
-
Stop Harbor.
sudo docker-compose down -v
-
Update
harbor.yml
.vim harbor.yml
-
Run the
prepare
script to populate the configuration.sudo prepare
To reconfigure Harbor to install Notary, Trivy, and the chart repository service, include all of the components in the
prepare
command.sudo prepare --with-notary --with-trivy --with-chartmuseum
-
Re-create and start the Harbor instance.
sudo docker-compose up -d
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/database
rm -r /data/registry
rm -r /data/redis