add an example of harbor systemd service (#17420)

Dependencies
1, You must have docker with compose plugin installed.
2, You must have the directory /etc/goharbor/harbor in your env.

Tested
1, ubuntu 20.04

Signed-off-by: Wang Yan <wangyan@vmware.com>
This commit is contained in:
Wang Yan 2022-08-17 16:53:13 +08:00 committed by GitHub
parent c9a61d37e3
commit 4faab2618e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,16 @@
[Unit]
Description=Harbor Cloud Native Registry
Documentation=https://goharbor.io
After=docker.service
Requires=docker.service
[Service]
Type=simple
Restart=on-failure
RestartSec=5
ExecStart=docker compose -f /etc/goharbor/harbor/docker-compose.yml up
ExecStop=docker compose -f /etc/goharbor/harbor/docker-compose.yml down -v
ExecStopPost=docker compose -f /etc/goharbor/harbor/docker-compose.yml rm -f
[Install]
WantedBy=multi-user.target