summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergej Pupykin2023-07-29 01:16:33 +0300
committerSergej Pupykin2023-07-29 01:16:33 +0300
commit440681c995983de210003c895c9b366b4637db73 (patch)
tree96844ca0a78b8303d2ab3f01168a26f4d4770a80
parent40fdd9722c60c2ba6c45ef045430ef80831835a9 (diff)
downloadaur-440681c995983de210003c895c9b366b4637db73.tar.gz
upd
-rw-r--r--.SRCINFO13
-rw-r--r--PKGBUILD23
-rw-r--r--config.yml.example16
-rw-r--r--registry.service9
-rw-r--r--registry.sysuser1
-rw-r--r--registry.tmpfiles1
6 files changed, 55 insertions, 8 deletions
diff --git a/.SRCINFO b/.SRCINFO
index bb7818735b73..e460e2cd1ecc 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,14 +1,21 @@
pkgbase = distribution
pkgdesc = the Open Source Registry implementation for storing and distributing container images using the OCI Distribution Specification
pkgver = 2.8.2git
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/distribution/distribution/
arch = x86_64
license = GPL
makedepends = go
- depends = go
- depends = git
+ makedepends = git
source = git+https://github.com/distribution/distribution.git
+ source = registry.sysuser
+ source = registry.service
+ source = registry.tmpfiles
+ source = config.yml.example
sha256sums = SKIP
+ sha256sums = 8f967e91e3a952628378ff71aeeace48f5d29883a7a0eec26d0ab1485c354b07
+ sha256sums = 24793414a56feca9c9d908018652da1ddf19e91d6ed10ac9a0900daf2a5688cf
+ sha256sums = 6dea38e5e572c54c8474670c69bcc61c70d8213d063a0767083b82ccec4d7064
+ sha256sums = c8755adfcc2ae168947b1e60a404dee725a84185b5363d505303fb289c9d16fa
pkgname = distribution
diff --git a/PKGBUILD b/PKGBUILD
index a4da48f7be63..56739a5a5131 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,15 +1,23 @@
pkgname=distribution
pkgver=2.8.2git # fails to build from tag
-pkgrel=1
+pkgrel=2
pkgdesc="the Open Source Registry implementation for storing and distributing container images using the OCI Distribution Specification"
arch=(x86_64)
url="https://github.com/distribution/distribution/"
license=('GPL')
-depends=('go' 'git')
-makedepends=('go')
+depends=()
+makedepends=('go' 'git')
#source=("git+https://github.com/distribution/distribution.git#tag=v$pkgver")
-source=("git+https://github.com/distribution/distribution.git")
-sha256sums=('SKIP')
+source=("git+https://github.com/distribution/distribution.git"
+ registry.sysuser
+ registry.service
+ registry.tmpfiles
+ config.yml.example)
+sha256sums=('SKIP'
+ '8f967e91e3a952628378ff71aeeace48f5d29883a7a0eec26d0ab1485c354b07'
+ '24793414a56feca9c9d908018652da1ddf19e91d6ed10ac9a0900daf2a5688cf'
+ '6dea38e5e572c54c8474670c69bcc61c70d8213d063a0767083b82ccec4d7064'
+ 'c8755adfcc2ae168947b1e60a404dee725a84185b5363d505303fb289c9d16fa')
prepare() {
cd "$pkgname"
@@ -27,4 +35,9 @@ package() {
install -Dm0755 bin/digest "$pkgdir"/usr/bin/digest
install -Dm0755 bin/registry "$pkgdir"/usr/bin/registry
install -Dm0755 bin/registry-api-descriptor-template "$pkgdir"/usr/bin/registry-api-descriptor-template
+
+ install -Dm0644 "$srcdir"/registry.service "$pkgdir"/usr/lib/systemd/system/registry.service
+ install -Dm0644 "$srcdir"/registry.sysuser "$pkgdir"/usr/lib/sysusers.d/registry.conf
+ install -Dm0644 "$srcdir"/registry.tmpfiles "$pkgdir"/usr/lib/tmpfiles.d/registry.conf
+ install -Dm0644 "$srcdir"/config.yml.example "$pkgdir"/etc/docker/registry/config.yml.example
}
diff --git a/config.yml.example b/config.yml.example
new file mode 100644
index 000000000000..d312abbd2415
--- /dev/null
+++ b/config.yml.example
@@ -0,0 +1,16 @@
+version: 0.1
+http:
+ addr: 0.0.0.0:5000
+ host: https://registry.example.com:5006
+storage:
+ filesystem:
+ rootdirectory: /var/lib/registry
+ maxthreads: 100
+ delete:
+ enabled: true
+auth:
+ token:
+ realm: https://gitlab.example.com/jwt/auth
+ service: container_registry
+ issuer: gitlab-issuer
+ rootcertbundle: /etc/docker/registry/docker-registry.crt
diff --git a/registry.service b/registry.service
new file mode 100644
index 000000000000..b5967db23656
--- /dev/null
+++ b/registry.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Docker Registry
+
+[Service]
+User=registry
+ExecStart=/usr/bin/registry serve /etc/docker/registry/config.yml
+
+[Install]
+WantedBy=multi-user.target
diff --git a/registry.sysuser b/registry.sysuser
new file mode 100644
index 000000000000..79b2688b858c
--- /dev/null
+++ b/registry.sysuser
@@ -0,0 +1 @@
+u registry - "container registry daemon user" /var/lib/registry /usr/bin/false \ No newline at end of file
diff --git a/registry.tmpfiles b/registry.tmpfiles
new file mode 100644
index 000000000000..32b865eb2b2c
--- /dev/null
+++ b/registry.tmpfiles
@@ -0,0 +1 @@
+d /var/lib/registry 0750 registry registry -