From 4faab2618ea12e60a734422b5c6392207cd039a0 Mon Sep 17 00:00:00 2001 From: Wang Yan Date: Wed, 17 Aug 2022 16:53:13 +0800 Subject: [PATCH] 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 --- tools/systemd/harbor.service | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tools/systemd/harbor.service diff --git a/tools/systemd/harbor.service b/tools/systemd/harbor.service new file mode 100644 index 000000000..90bac8fc4 --- /dev/null +++ b/tools/systemd/harbor.service @@ -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 \ No newline at end of file