From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:33992) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4E0J-0003Xa-CF for guix-patches@gnu.org; Sat, 31 Aug 2019 20:46:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i4E0I-0006VB-2C for guix-patches@gnu.org; Sat, 31 Aug 2019 20:46:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:47257) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i4E0H-0006UY-V9 for guix-patches@gnu.org; Sat, 31 Aug 2019 20:46:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i4E0H-00080F-Ql for guix-patches@gnu.org; Sat, 31 Aug 2019 20:46:01 -0400 Subject: [bug#37250] [PATCH] gnu: docker: Add support for tini. Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:33975) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4E09-0003XR-Mu for guix-patches@gnu.org; Sat, 31 Aug 2019 20:45:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i4E08-00066b-8V for guix-patches@gnu.org; Sat, 31 Aug 2019 20:45:53 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]:41361) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i4E07-000627-Ui for guix-patches@gnu.org; Sat, 31 Aug 2019 20:45:52 -0400 Received: by mail-pl1-x62b.google.com with SMTP id m9so4989212pls.8 for ; Sat, 31 Aug 2019 17:45:51 -0700 (PDT) Received: from x200 ([240f:c7:38e9:1:314b:485c:9ba4:72c6]) by smtp.gmail.com with ESMTPSA id v67sm16045885pfb.45.2019.08.31.17.45.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Aug 2019 17:45:49 -0700 (PDT) From: Maxim Cournoyer Date: Sun, 01 Sep 2019 18:44:30 +0900 Message-ID: <87ftlge4g1.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 37250@debbugs.gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Hello! This enables the use of the --init argument for example with 'docker run'. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-gnu-Add-tini.patch Content-Transfer-Encoding: quoted-printable From=20fdf8690097a236ce5799b70cf4e43ccf7e420022 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Thu, 29 Aug 2019 10:01:11 +0900 Subject: [PATCH 1/2] gnu: Add tini. * gnu/packages/docker.scm (tini): New variable. =2D-- gnu/packages/docker.scm | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/gnu/packages/docker.scm b/gnu/packages/docker.scm index 94cfa2bdb7..8f80cd54d8 100644 =2D-- 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, wi= th + ;; the error: "No valid ELF RPATH or RUNPATH entry exi= sts + ;; 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 wi= th +containers. It manages a single child process and ensures that any zombie +processes produced from it are reaped and that signals are properly forwar= ded. +Tini is integrated with Docker.") + (license license:expat))) =2D-=20 2.23.0 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-gnu-docker-Add-support-for-tini.patch Content-Transfer-Encoding: quoted-printable From=20eb575e31612d89763454eb82bbfd64f87d74be9c Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer 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. =2D-- gnu/packages/docker.scm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gnu/packages/docker.scm b/gnu/packages/docker.scm index 8f80cd54d8..28eff0a56c 100644 =2D-- a/gnu/packages/docker.scm +++ b/gnu/packages/docker.scm @@ -369,7 +369,16 @@ built-in registry server of Docker.") (("StockRuntimeName =3D .*") (string-append "StockRuntimeName =3D \"" (assoc-ref inputs "runc") =2D "/sbin/runc\"\n"))) + "/sbin/runc\"\n")) + (("DefaultInitBinary =3D .*") + (string-append "DefaultInitBinary =3D \"" + (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/runcex= ecutor/executor.go" (("var defaultCommandCandidates =3D .*") (string-append "var defaultCommandCandidates =3D []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 =2D-=20 2.23.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEJ9WGpPiQCFQyn/CfEmDkZILmNWIFAl1rkv4ACgkQEmDkZILm NWLJKA/8DxJ25h1CZUEIGQRbkLPP/ub8xdIW/q0XltOVKHv3ZFzrrtoyfiCAGWT8 U5LAtE+pqArZ20VlqPbeY5AecbjVoN1I/ksN6BUnYCWdFvnTFckB417sRuH0kaB0 yywQT5gfdO3DD5EcB50YCVb11NjSfNqbZnV4ir4FjYYzueBl30/x8tk9RBeSVZma i4KXOm5a4NHPdSBsTWWHveRmIYvjJqLZDpsYn4IYVN4yNivLE5ASmDyifzDn3hDt UwmuL8n//bhZbbAg9RWliPT9Wi8Ry0dPpozzw4ZugMaB8FY90sf+SolqzZGG0RoR YHXy8Qo8XbQta7a3XwBMb7Kdp8N8PopwvbcCBXezZD96ne9zVpkq3vTYHR00Xbtu AugnJMfye8hWLUcG7rEEkRv8mgFxzW7zbC6wVYWhd6E8ghu8D+IWJCWF3F23bbB7 GE6BenQSWGoaJGEHd2vpb7/c0SGp5+IJWKjV6dELlZInRNwLxgEiIYNwqvQtEPr5 whOxJEFhuMvA+060kcdyuBpsG9DEM/gkAQ6IoZqr/kQr6PitWULB3rRZ7PmyJ4Mh 3VMD6EjdvMgIW8Hz7ltLMPdRrsU3FCkKEuiq8GB/eWkVaEm5cHo2AQkVkQMjPv1N O1jXLcEiI+4j/TFRI5H+gFxpCRXkQlWyrgAlpPslrurYARfUGxQ= =vqfw -----END PGP SIGNATURE----- --==-=-=--