summaryrefslogtreecommitdiff
path: root/gnu/packages
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2023-01-14 19:26:00 +0100
committerChristopher Baines <mail@cbaines.net>2023-02-17 15:44:59 +0000
commit46013fccb701ebd6d55a9be3374e4fbbf877e3a2 (patch)
tree7223bd9eae210b55736375ced9e2284fa61b97ef /gnu/packages
parentfc36ea0a0a40c618ee3488d8432ebb6d27b56fa3 (diff)
gnu: Add docker-registry.
* gnu/packages/docker.scm (docker-registry): New variable. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> Signed-off-by: Christopher Baines <mail@cbaines.net>
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/docker.scm82
1 files changed, 82 insertions, 0 deletions
diff --git a/gnu/packages/docker.scm b/gnu/packages/docker.scm
index 7d109dc94c2..44e9ddd2e87 100644
--- a/gnu/packages/docker.scm
+++ b/gnu/packages/docker.scm
@@ -724,3 +724,85 @@ containers. It manages a single child process and ensures that any zombie
724processes produced from it are reaped and that signals are properly forwarded. 724processes produced from it are reaped and that signals are properly forwarded.
725Tini is integrated with Docker.") 725Tini is integrated with Docker.")
726 (license license:expat))) 726 (license license:expat)))
727
728(define-public docker-registry
729 (package
730 (name "docker-registry")
731 (version "2.8.1")
732 (source (origin
733 (method git-fetch)
734 (uri (git-reference
735 (url "https://github.com/docker/distribution")
736 (commit (string-append "v" version))))
737 (file-name (git-file-name name version))
738 (sha256
739 (base32
740 "1w8zr97p2c62gm1lrdwqa704ivjsy25ylznrddbbpv63idwdbi9k"))))
741 (build-system go-build-system)
742 (arguments
743 (list
744 #:import-path "github.com/docker/distribution"
745 #:phases
746 #~(modify-phases %standard-phases
747 (add-after 'unpack 'chdir-to-src
748 (lambda _ (chdir "src/github.com/docker/distribution")))
749 (add-after 'chdir-to-src 'fix-versioning
750 (lambda _
751 ;; The Makefile use git to compute the version and the
752 ;; revision. This requires the .git directory that we don't have
753 ;; anymore in the unpacked source.
754 (substitute* "Makefile"
755 (("^VERSION=\\$\\(.*\\)")
756 (string-append "VERSION=v" #$version))
757 ;; The revision originally used the git hash with .m appended
758 ;; if there was any local modifications.
759 (("^REVISION=\\$\\(.*\\)") "REVISION=0"))))
760 (replace 'build
761 (lambda _
762 (invoke "make" "binaries")))
763 (replace 'install
764 (lambda _
765 (let ((bin (string-append #$output "/bin")))
766 (mkdir-p bin)
767 (for-each
768 (lambda (file)
769 (install-file (string-append "bin/" file) bin))
770 '("digest"
771 "registry"
772 "registry-api-descriptor-template")))
773 (let ((doc (string-append
774 #$output "/share/doc/" #$name "-" #$version)))
775 (mkdir-p doc)
776 (for-each
777 (lambda (file)
778 (install-file file doc))
779 '("BUILDING.md"
780 "CONTRIBUTING.md"
781 "LICENSE"
782 "MAINTAINERS"
783 "README.md"
784 "ROADMAP.md"))
785 (copy-recursively "docs/" (string-append doc "/docs")))
786 (let ((examples
787 (string-append
788 #$output "/share/doc/" #$name "-" #$version
789 "/registry-example-configs")))
790 (mkdir-p examples)
791 (for-each
792 (lambda (file)
793 (install-file (string-append "cmd/registry/" file) examples))
794 '("config-cache.yml"
795 "config-example.yml"
796 "config-dev.yml")))))
797 (delete 'install-license-files))))
798 (home-page "https://github.com/docker/distribution")
799 (synopsis "Docker registry server and associated tools")
800 (description "The Docker registry server enable you to host your own
801docker registry. With it, there is also two other utilities:
802@itemize
803@item The digest utility is a tool that generates checksums compatibles with
804various docker manifest files.
805@item The registry-api-descriptor-template is a tool for generating API
806specifications from the docs/spec/api.md.tmpl file.
807@end itemize")
808 (license license:asl2.0)))