From patchwork Sat Jan 14 18:26:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis 'GNUtoo' Carikli X-Patchwork-Id: 46116 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0DF9C27BBED; Sat, 14 Jan 2023 18:27:37 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 019B927BBE9 for ; Sat, 14 Jan 2023 18:27:36 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGlFC-0005pv-9m; Sat, 14 Jan 2023 13:27:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pGlF8-0005pA-K5 for guix-patches@gnu.org; Sat, 14 Jan 2023 13:27:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGlF8-000200-C2 for guix-patches@gnu.org; Sat, 14 Jan 2023 13:27:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pGlF8-0005OW-1X for guix-patches@gnu.org; Sat, 14 Jan 2023 13:27:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60770] [PATCH v2] gnu: Add docker-registry References: <20230113045918.20196-1-GNUtoo@cyberdimension.org> In-Reply-To: <20230113045918.20196-1-GNUtoo@cyberdimension.org> Resent-From: Denis 'GNUtoo' Carikli Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 14 Jan 2023 18:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60770 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60770@debbugs.gnu.org Cc: Denis 'GNUtoo' Carikli Received: via spool by 60770-submit@debbugs.gnu.org id=B60770.167372080020699 (code B ref 60770); Sat, 14 Jan 2023 18:27:02 +0000 Received: (at 60770) by debbugs.gnu.org; 14 Jan 2023 18:26:40 +0000 Received: from localhost ([127.0.0.1]:55534 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pGlEm-0005Nn-5q for submit@debbugs.gnu.org; Sat, 14 Jan 2023 13:26:40 -0500 Received: from cyberdimension.org ([80.67.179.20]:39550 helo=gnutoo.cyberdimension.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pGlEi-0005Nc-Kq for 60770@debbugs.gnu.org; Sat, 14 Jan 2023 13:26:38 -0500 Received: from gnutoo.cyberdimension.org (localhost [127.0.0.1]) by cyberdimension.org (OpenSMTPD) with ESMTP id f88deea5; Sat, 14 Jan 2023 18:23:51 +0000 (UTC) Received: from localhost.localdomain (localhost [::1]) by gnutoo.cyberdimension.org (OpenSMTPD) with ESMTP id 242415e0; Sat, 14 Jan 2023 18:23:51 +0000 (UTC) From: Denis 'GNUtoo' Carikli Date: Sat, 14 Jan 2023 19:26:00 +0100 Message-Id: <20230114182600.13639-1-GNUtoo@cyberdimension.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/docker.scm (docker-registry): New variable. Signed-off-by: Denis 'GNUtoo' Carikli --- gnu/packages/docker.scm | 81 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) base-commit: ef0613a81dca73602e702cb5f5444ee94566f983 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)))