integ/kubernetes/docker-distribution/debian/deb_patches/0001-update-paths-and-service.patch
Daniel Safta b9d28e3c56 Add debian package for docker-distribution
- created required debian structure
- successfully built the package
- applied stx config changes and updated
paths from /etc/docker to /etc/docker-distribution
through patches

Story: 2009221
Task: 43631
Signed-off-by: Daniel Safta <daniel.safta@windriver.com>
Change-Id: I5af677c90342bae7c10101bf100e1db79c716670
2021-11-03 13:11:40 +02:00

69 lines
2.4 KiB
Diff

From 922d937e24a4a0cd9d826579eeb9afed4f7c234c Mon Sep 17 00:00:00 2001
From: Daniel Safta <daniel.safta@windriver.com>
Date: Wed, 3 Nov 2021 09:48:45 +0000
Subject: [PATCH] debian-patches
---
debian/docker-registry.init | 2 +-
debian/docker-registry.install | 2 +-
debian/docker-registry.postinst | 2 +-
debian/docker-registry.service | 7 ++++++-
4 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/debian/docker-registry.init b/debian/docker-registry.init
index c225130..c03a67a 100644
--- a/debian/docker-registry.init
+++ b/debian/docker-registry.init
@@ -13,7 +13,7 @@ set -e
BASE=docker-registry
BINARY=/usr/bin/$BASE
-CONFIG=/etc/docker/registry/config.yml
+CONFIG=/etc/docker-distribution/registry/config.yml
EXECUSER=docker-registry
PIDFILE=/var/run/$BASE.pid
LOGFILE=/var/log/$BASE.log
diff --git a/debian/docker-registry.install b/debian/docker-registry.install
index ea1de25..6ed37e3 100755
--- a/debian/docker-registry.install
+++ b/debian/docker-registry.install
@@ -1,3 +1,3 @@
#!/usr/bin/dh-exec
usr/bin/registry => usr/bin/docker-registry
-cmd/registry/config-example.yml => etc/docker/registry/config.yml
+cmd/registry/config-example.yml => etc/docker-distribution/registry/config.yml
diff --git a/debian/docker-registry.postinst b/debian/docker-registry.postinst
index 96ded3c..d179197 100755
--- a/debian/docker-registry.postinst
+++ b/debian/docker-registry.postinst
@@ -15,7 +15,7 @@ if [ "$1" = 'configure' ]; then
# On a fresh install, $2 = '' and dpkg treat that as a
# lower version, so the permissions get fixed too.
if dpkg --compare-versions "$2" le '2.4.1~ds1-1'; then
- chmod 0755 /etc/docker
+ chmod 0755 /etc/docker-distribution
fi
# ensure home directory ownership (logic borrowed from postgresql-common)
diff --git a/debian/docker-registry.service b/debian/docker-registry.service
index 066e38a..a2feaa6 100644
--- a/debian/docker-registry.service
+++ b/debian/docker-registry.service
@@ -4,7 +4,12 @@ After=network.target
[Service]
User=docker-registry
-ExecStart=/usr/bin/docker-registry serve /etc/docker/registry/config.yml
+Type=simple
+Environment=REGISTRY_STORAGE_DELETE_ENABLED=true
+ExecStart=/usr/bin/docker-registry serve /etc/docker-distribution/registry/config.yml
+Restart=on-failure
+ExecStartPost=/bin/bash -c 'echo $MAINPID > /var/run/docker-distribution.pid'
+ExecStopPost=/bin/rm -f /var/run/docker-distribution.pid
[Install]
WantedBy=multi-user.target
--
2.30.2