GNU bug report logs - #60770
[PATCH v1] gnu: Add docker-registry

Previous Next

Package: guix-patches;

Reported by: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>

Date: Fri, 13 Jan 2023 05:00:02 UTC

Severity: normal

Tags: patch

Done: Christopher Baines <mail <at> cbaines.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 60770 in the body.
You can then email your comments to 60770 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#60770; Package guix-patches. (Fri, 13 Jan 2023 05:00:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 13 Jan 2023 05:00:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
To: guix-patches <at> gnu.org
Cc: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
Subject: [PATCH v1] gnu: Add docker-registry
Date: Fri, 13 Jan 2023 05:59:18 +0100
* gnu/packages/docker.scm (docker-registry): New variable.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
---
 gnu/packages/docker.scm | 80 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 80 insertions(+)

diff --git a/gnu/packages/docker.scm b/gnu/packages/docker.scm
index 7d109dc94c..807c855a1a 100644
--- a/gnu/packages/docker.scm
+++ b/gnu/packages/docker.scm
@@ -724,3 +724,83 @@ (define-public tini
 processes produced from it are reaped and that signals are properly forwarded.
 Tini is integrated with Docker.")
     (license license:expat)))
+
+(define-public docker-registry
+  (package
+    (name "docker-registry")
+    (version "2.8.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/docker/distribution")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1w8zr97p2c62gm1lrdwqa704ivjsy25ylznrddbbpv63idwdbi9k"))))
+    (build-system go-build-system)
+    (arguments
+     (list
+      #:import-path "github.com/docker/distribution"
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'chdir-to-src
+            (lambda _ (chdir "src/github.com/docker/distribution")))
+          (add-after 'chdir-to-src 'fix-versioning
+            (lambda _
+              ;; The Makefile use git to compute the version and the
+              ;; revision. This requires the .git directory that we don't
+              ;; have anymore in the unpacked source.
+              (substitute* "Makefile" (("^VERSION=\\$\\(.*\\)")
+                                       (string-append "VERSION=v" #$version))
+                           ;; The revision originally used the git hash with .m
+                           ;; appended if there was any local modifications.
+                           (("^REVISION=\\$\\(.*\\)") "REVISION=0"))))
+          (replace 'build
+            (lambda _
+              (invoke "make" "binaries")))
+          (replace 'install
+            (lambda _
+              (let ((bin (string-append #$output "/bin")))
+                (mkdir-p bin)
+                (for-each
+                 (lambda (file)
+                   (install-file (string-append "bin/" file) bin))
+                 '("digest"
+                   "registry"
+                   "registry-api-descriptor-template")))
+              (let ((doc (string-append
+                          #$output "/share/doc/" #$name "-" #$version)))
+                (mkdir-p doc)
+                (for-each
+                 (lambda (file)
+                   (install-file file doc))
+                 '("BUILDING.md"
+                   "CONTRIBUTING.md"
+                   "LICENSE"
+                   "MAINTAINERS"
+                   "README.md"
+                   "ROADMAP.md")))
+              (let ((examples
+                     (string-append
+                      #$output "/share/doc/" #$name "-" #$version
+                      "/registry-example-configs")))
+                (mkdir-p examples)
+                (for-each
+                 (lambda (file)
+                   (install-file (string-append "cmd/registry/" file) examples))
+                 '("config-cache.yml"
+                   "config-example.yml"
+                   "config-dev.yml")))))
+      (delete 'install-license-files))))
+  (home-page "https://github.com/docker/distribution")
+  (synopsis "Docker registry server and associated tools")
+  (description "The Docker registry server enable you to host your own
+docker registry. With it, there is also two other utilities:
+@itemize
+@item The digest utility is a tool that generates checksums compatibles with
+various docker manifest files.
+@item The registry-api-descriptor-template is a tool for generating API
+specifications from the docs/spec/api.md.tmpl file.
+@end itemize")
+  (license license:asl2.0)))

base-commit: ef0613a81dca73602e702cb5f5444ee94566f983
-- 
2.38.1





Information forwarded to guix-patches <at> gnu.org:
bug#60770; Package guix-patches. (Sat, 14 Jan 2023 18:27:02 GMT) Full text and rfc822 format available.

Message #8 received at 60770 <at> debbugs.gnu.org (full text, mbox):

From: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
To: 60770 <at> debbugs.gnu.org
Cc: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
Subject: [PATCH v2] gnu: Add docker-registry
Date: Sat, 14 Jan 2023 19:26:00 +0100
* gnu/packages/docker.scm (docker-registry): New variable.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
---
 gnu/packages/docker.scm | 81 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 81 insertions(+)

diff --git a/gnu/packages/docker.scm b/gnu/packages/docker.scm
index 7d109dc94c..58c61ba02e 100644
--- a/gnu/packages/docker.scm
+++ b/gnu/packages/docker.scm
@@ -724,3 +724,84 @@ (define-public tini
 processes produced from it are reaped and that signals are properly forwarded.
 Tini is integrated with Docker.")
     (license license:expat)))
+
+(define-public docker-registry
+  (package
+    (name "docker-registry")
+    (version "2.8.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/docker/distribution")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1w8zr97p2c62gm1lrdwqa704ivjsy25ylznrddbbpv63idwdbi9k"))))
+    (build-system go-build-system)
+    (arguments
+     (list
+      #:import-path "github.com/docker/distribution"
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'chdir-to-src
+            (lambda _ (chdir "src/github.com/docker/distribution")))
+          (add-after 'chdir-to-src 'fix-versioning
+            (lambda _
+              ;; The Makefile use git to compute the version and the
+              ;; revision. This requires the .git directory that we don't
+              ;; have anymore in the unpacked source.
+              (substitute* "Makefile" (("^VERSION=\\$\\(.*\\)")
+                                       (string-append "VERSION=v" #$version))
+                           ;; The revision originally used the git hash with .m
+                           ;; appended if there was any local modifications.
+                           (("^REVISION=\\$\\(.*\\)") "REVISION=0"))))
+          (replace 'build
+            (lambda _
+              (invoke "make" "binaries")))
+          (replace 'install
+            (lambda _
+              (let ((bin (string-append #$output "/bin")))
+                (mkdir-p bin)
+                (for-each
+                 (lambda (file)
+                   (install-file (string-append "bin/" file) bin))
+                 '("digest"
+                   "registry"
+                   "registry-api-descriptor-template")))
+              (let ((doc (string-append
+                          #$output "/share/doc/" #$name "-" #$version)))
+                (mkdir-p doc)
+                (for-each
+                 (lambda (file)
+                   (install-file file doc))
+                 '("BUILDING.md"
+                   "CONTRIBUTING.md"
+                   "LICENSE"
+                   "MAINTAINERS"
+                   "README.md"
+                   "ROADMAP.md"))
+                (copy-recursively "docs/" (string-append doc "/docs")))
+              (let ((examples
+                     (string-append
+                      #$output "/share/doc/" #$name "-" #$version
+                      "/registry-example-configs")))
+                (mkdir-p examples)
+                (for-each
+                 (lambda (file)
+                   (install-file (string-append "cmd/registry/" file) examples))
+                 '("config-cache.yml"
+                   "config-example.yml"
+                   "config-dev.yml")))))
+      (delete 'install-license-files))))
+  (home-page "https://github.com/docker/distribution")
+  (synopsis "Docker registry server and associated tools")
+  (description "The Docker registry server enable you to host your own
+docker registry. With it, there is also two other utilities:
+@itemize
+@item The digest utility is a tool that generates checksums compatibles with
+various docker manifest files.
+@item The registry-api-descriptor-template is a tool for generating API
+specifications from the docs/spec/api.md.tmpl file.
+@end itemize")
+  (license license:asl2.0)))

base-commit: ef0613a81dca73602e702cb5f5444ee94566f983
-- 
2.38.1





Information forwarded to guix-patches <at> gnu.org:
bug#60770; Package guix-patches. (Mon, 23 Jan 2023 18:57:02 GMT) Full text and rfc822 format available.

Message #11 received at 60770 <at> debbugs.gnu.org (full text, mbox):

From: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
To: 60770 <at> debbugs.gnu.org
Subject: Re: [PATCH v2] gnu: Add docker-registry
Date: Mon, 23 Jan 2023 19:55:56 +0100
[Message part 1 (text/plain, inline)]
Hi again,

For this patch I checked if there were bundled dependencies with the
'guix import go -r github.com/docker/distribution' command and it found
nothing.

However the way this software is built it a bit strange and I just
found out that there are still bundled in dependencies.

So I guess that at the minimum we need to review the licenses of the
dependencies as well.

Denis.
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#60770; Package guix-patches. (Fri, 17 Feb 2023 16:28:01 GMT) Full text and rfc822 format available.

Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
Cc: 60770-done <at> debbugs.gnu.org, guix-patches <at> gnu.org
Subject: Re: [bug#60770] [PATCH v2] gnu: Add docker-registry
Date: Fri, 17 Feb 2023 16:23:57 +0000
[Message part 1 (text/plain, inline)]
Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org> writes:

> * gnu/packages/docker.scm (docker-registry): New variable.
>
> Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
> ---
>  gnu/packages/docker.scm | 81 +++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 81 insertions(+)

I've gone ahead and pushed this to master now as
46013fccb701ebd6d55a9be3374e4fbbf877e3a2.

There's probably room for improvement in the packaging especially
removing some of the vendored dependencies, but I think this is OK to be
merged.
[signature.asc (application/pgp-signature, inline)]

Reply sent to Christopher Baines <mail <at> cbaines.net>:
You have taken responsibility. (Fri, 17 Feb 2023 16:28:02 GMT) Full text and rfc822 format available.

Notification sent to Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>:
bug acknowledged by developer. (Fri, 17 Feb 2023 16:28:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 18 Mar 2023 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 33 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.