[PATCH] gnu: docker: Add support for tini.

DoneSubmitted by Maxim Cournoyer.
Details
2 participants
  • Ludovic Courtès
  • Maxim Cournoyer
Owner
unassigned
Severity
normal
M
M
Maxim Cournoyer wrote on 1 Sep 2019 11:44
(name . guix-patches)(address . guix-patches@gnu.org)
87ftlge4g1.fsf@gmail.com
Hello!
This enables the use of the --init argument for example with 'dockerrun'.
From fdf8690097a236ce5799b70cf4e43ccf7e420022 Mon Sep 17 00:00:00 2001From: Maxim Cournoyer <maxim.cournoyer@gmail.com>Date: Thu, 29 Aug 2019 10:01:11 +0900Subject: [PATCH 1/2] gnu: Add tini.
* gnu/packages/docker.scm (tini): New variable.--- gnu/packages/docker.scm | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)
Toggle diff (51 lines)diff --git a/gnu/packages/docker.scm b/gnu/packages/docker.scmindex 94cfa2bdb7..8f80cd54d8 100644--- a/gnu/packages/docker.scm+++ b/gnu/packages/docker.scm@@ -25,6 +25,7 @@ #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download)+ #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module (guix build-system go) #:use-module (guix build-system python)@@ -655,3 +656,36 @@ provisioning etc.") way to run commands in the current directory, but within a Docker container defined in a per-project configuration file.") (license license:gpl3+)))++(define-public tini+ (package+ (name "tini")+ (version "0.18.0")+ (source (origin+ (method git-fetch)+ (uri (git-reference+ (url "https://github.com/krallin/tini.git")+ (commit (string-append "v" version))))+ (file-name (git-file-name name version))+ (sha256+ (base32+ "1h20i3wwlbd8x4jr2gz68hgklh0lb0jj7y5xk1wvr8y58fip1rdn"))))+ (build-system cmake-build-system)+ (arguments+ `(#:tests? #f ;tests require a Docker daemon+ #:phases (modify-phases %standard-phases+ (add-after 'unpack 'disable-static-build+ ;; Disable the static build as it fails to install, with+ ;; the error: "No valid ELF RPATH or RUNPATH entry exists+ ;; in the file".+ (lambda _+ (substitute* "CMakeLists.txt"+ ((".*tini-static.*") ""))+ #t)))))+ (home-page "https://github.com/krallin/tini")+ (synopsis "Tiny but valid init for containers")+ (description "Tini is an init program specifically designed for use with+containers. It manages a single child process and ensures that any zombie+processes produced from it are reaped and that signals are properly forwarded.+Tini is integrated with Docker.")+ (license license:expat)))-- 2.23.0
From eb575e31612d89763454eb82bbfd64f87d74be9c Mon Sep 17 00:00:00 2001From: Maxim Cournoyer <maxim.cournoyer@gmail.com>Date: Thu, 29 Aug 2019 10:01:43 +0900Subject: [PATCH 2/2] gnu: docker: Add support for tini.
* gnu/packages/docker.scm (docker)[inputs]: Add tini.[phases]{patch-paths}: Patch the path of the default init binary.--- gnu/packages/docker.scm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
Toggle diff (32 lines)diff --git a/gnu/packages/docker.scm b/gnu/packages/docker.scmindex 8f80cd54d8..28eff0a56c 100644--- a/gnu/packages/docker.scm+++ b/gnu/packages/docker.scm@@ -369,7 +369,16 @@ built-in registry server of Docker.") (("StockRuntimeName = .*") (string-append "StockRuntimeName = \"" (assoc-ref inputs "runc")- "/sbin/runc\"\n")))+ "/sbin/runc\"\n"))+ (("DefaultInitBinary = .*")+ (string-append "DefaultInitBinary = \""+ (assoc-ref inputs "tini")+ "/bin/tini\"\n")))+ (substitute* "daemon/config/config_common_unix_test.go"+ (("expectedInitPath: \"docker-init\"")+ (string-append "expectedInitPath: \""+ (assoc-ref inputs "tini")+ "/bin/tini\""))) (substitute* "vendor/github.com/moby/buildkit/executor/runcexecutor/executor.go" (("var defaultCommandCandidates = .*") (string-append "var defaultCommandCandidates = []string{\""@@ -542,6 +551,7 @@ built-in registry server of Docker.") ("runc" ,runc) ("util-linux" ,util-linux) ("lvm2" ,lvm2)+ ("tini" ,tini) ("xfsprogs" ,xfsprogs) ("xz" ,xz))) (native-inputs-- 2.23.0
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCAAdFiEEJ9WGpPiQCFQyn/CfEmDkZILmNWIFAl1rkv4ACgkQEmDkZILmNWLJKA/8DxJ25h1CZUEIGQRbkLPP/ub8xdIW/q0XltOVKHv3ZFzrrtoyfiCAGWT8U5LAtE+pqArZ20VlqPbeY5AecbjVoN1I/ksN6BUnYCWdFvnTFckB417sRuH0kaB0yywQT5gfdO3DD5EcB50YCVb11NjSfNqbZnV4ir4FjYYzueBl30/x8tk9RBeSVZmai4KXOm5a4NHPdSBsTWWHveRmIYvjJqLZDpsYn4IYVN4yNivLE5ASmDyifzDn3hDtUwmuL8n//bhZbbAg9RWliPT9Wi8Ry0dPpozzw4ZugMaB8FY90sf+SolqzZGG0RoRYHXy8Qo8XbQta7a3XwBMb7Kdp8N8PopwvbcCBXezZD96ne9zVpkq3vTYHR00XbtuAugnJMfye8hWLUcG7rEEkRv8mgFxzW7zbC6wVYWhd6E8ghu8D+IWJCWF3F23bbB7GE6BenQSWGoaJGEHd2vpb7/c0SGp5+IJWKjV6dELlZInRNwLxgEiIYNwqvQtEPr5whOxJEFhuMvA+060kcdyuBpsG9DEM/gkAQ6IoZqr/kQr6PitWULB3rRZ7PmyJ4Mh3VMD6EjdvMgIW8Hz7ltLMPdRrsU3FCkKEuiq8GB/eWkVaEm5cHo2AQkVkQMjPv1NO1jXLcEiI+4j/TFRI5H+gFxpCRXkQlWyrgAlpPslrurYARfUGxQ==vqfw-----END PGP SIGNATURE-----
L
L
Ludovic Courtès wrote on 4 Sep 2019 23:34
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)(address . 37250@debbugs.gnu.org)
87y2z3zqx3.fsf@gnu.org
Hello Maxim,
Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:
Toggle quote (7 lines)> From fdf8690097a236ce5799b70cf4e43ccf7e420022 Mon Sep 17 00:00:00 2001> From: Maxim Cournoyer <maxim.cournoyer@gmail.com>> Date: Thu, 29 Aug 2019 10:01:11 +0900> Subject: [PATCH 1/2] gnu: Add tini.>> * gnu/packages/docker.scm (tini): New variable.
[...]
Toggle quote (8 lines)> From eb575e31612d89763454eb82bbfd64f87d74be9c Mon Sep 17 00:00:00 2001> From: Maxim Cournoyer <maxim.cournoyer@gmail.com>> Date: Thu, 29 Aug 2019 10:01:43 +0900> Subject: [PATCH 2/2] gnu: docker: Add support for tini.>> * gnu/packages/docker.scm (docker)[inputs]: Add tini.> [phases]{patch-paths}: Patch the path of the default init binary.
LGTM, thanks!
Ludo’.
M
M
Maxim Cournoyer wrote on 5 Sep 2019 03:31
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 37250-done@debbugs.gnu.org)
87lfv3y1eq.fsf@gmail.com
Ludovic Courtès <ludo@gnu.org> writes:
Toggle quote (25 lines)> Hello Maxim,>> Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:>>> From fdf8690097a236ce5799b70cf4e43ccf7e420022 Mon Sep 17 00:00:00 2001>> From: Maxim Cournoyer <maxim.cournoyer@gmail.com>>> Date: Thu, 29 Aug 2019 10:01:11 +0900>> Subject: [PATCH 1/2] gnu: Add tini.>>>> * gnu/packages/docker.scm (tini): New variable.>> [...]>>> From eb575e31612d89763454eb82bbfd64f87d74be9c Mon Sep 17 00:00:00 2001>> From: Maxim Cournoyer <maxim.cournoyer@gmail.com>>> Date: Thu, 29 Aug 2019 10:01:43 +0900>> Subject: [PATCH 2/2] gnu: docker: Add support for tini.>>>> * gnu/packages/docker.scm (docker)[inputs]: Add tini.>> [phases]{patch-paths}: Patch the path of the default init binary.>> LGTM, thanks!>> Ludo’.
Thank you! Merged with commit b8e7e20841.
Maxim
Closed
?
Your comment

This issue is archived.

To comment on this conversation send email to 37250@debbugs.gnu.org