[{"id":1773125,"web_url":"http://patchwork.ozlabs.org/comment/1773125/","msgid":"<859c9ec7-7a17-cfef-ac9f-8982d8f8c086@mind.be>","list_archive_url":null,"date":"2017-09-21T21:37:08","subject":"Re: [Buildroot] [PATCH 3/9] docker-engine: add support for init\n\tprocesses","submitter":{"id":11809,"url":"http://patchwork.ozlabs.org/api/people/11809/","name":"Arnout Vandecappelle","email":"arnout@mind.be"},"content":"On 20-09-17 05:02, Christian Stewart wrote:\n> When a docker container is run with the --init flag, the Docker engine\n> uses the docker-init binary as PID 1 inside the container. This is\n> necessary in may cases to avoid issues with signal handling, zombie\n> processes, and other quirks when running as PID 1.\n> \n> The docker-init binary is backed by tini on default, but optionally can\n> be changed to docker-init by user preference.\n\n OK, now I get the reason to build dumb-init statically: it actually comes from\noutside the container, not inside. Honestly I don't understand why it takes an\nexecutable from outside the container to run inside it, but OK.\n\n> \n> Furthermore, this patch fixes the following Docker error:\n> \n>   dockerd: level=warning msg=\"failed to retrieve docker-init version\"\n\n On my Debian system there is no docker-init but I don't get this warning when\nstarting docker...\n\n\n> \n> Signed-off-by: Christian Stewart <christian@paral.in>\n\nReviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>\n\n Small nit below.\n\n> ---\n>  package/docker-engine/Config.in        | 26 ++++++++++++++++++++++++++\n>  package/docker-engine/docker-engine.mk | 11 +++++++++++\n>  2 files changed, 37 insertions(+)\n> \n> diff --git a/package/docker-engine/Config.in b/package/docker-engine/Config.in\n> index 05670a716e..7d9a87f7bb 100644\n> --- a/package/docker-engine/Config.in\n> +++ b/package/docker-engine/Config.in\n> @@ -33,6 +33,32 @@ config BR2_PACKAGE_DOCKER_ENGINE_STATIC_CLIENT\n>  \n>  if BR2_PACKAGE_DOCKER_ENGINE_DAEMON\n>  \n> +choice\n> +\tbool \"docker-init to use\"\n> +\tdefault BR2_PACKAGE_DOCKER_ENGINE_INIT_TINI\n> +\thelp\n> +\t  The docker engine uses a minimal init process as PID 1\n> +\t  inside containers. There are several implementations\n> +\t  of this init process.\n> +\n> +config BR2_PACKAGE_DOCKER_ENGINE_INIT_TINI\n> +\tbool \"tini\"\n> +\tselect BR2_PACKAGE_TINI\n> +\thelp\n> +\t  Use Tini as the container init process.\n> +\n> +\t  https://github.com/krallin/tini\n\n Upstream URL is not needed here, only in the package itself.\n\n It might be useful to add some help text that indicates the difference between\ntini and dumb-init.\n\n\n Regards,\n Arnout\n\n\n> +\n> +config BR2_PACKAGE_DOCKER_ENGINE_INIT_DUMB_INIT\n> +\tbool \"dumb-init\"\n> +\tselect BR2_PACKAGE_DUMB_INIT\n> +\thelp\n> +\t  Use dumb-init as the container init process.\n> +\n> +\t  https://github.com/Yelp/dumb-init\n> +\n> +endchoice\n> +\n>  config BR2_PACKAGE_DOCKER_ENGINE_DRIVER_BTRFS\n>  \tbool \"btrfs filesystem driver\"\n>  \tdepends on BR2_USE_MMU # btrfs-progs\n> diff --git a/package/docker-engine/docker-engine.mk b/package/docker-engine/docker-engine.mk\n> index 8928f072e7..a2776ed78c 100644\n> --- a/package/docker-engine/docker-engine.mk\n> +++ b/package/docker-engine/docker-engine.mk\n> @@ -50,6 +50,13 @@ endif\n>  ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DAEMON),y)\n>  DOCKER_ENGINE_BUILD_TAGS += daemon\n>  DOCKER_ENGINE_BUILD_TARGETS += dockerd\n> +\n> +ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_INIT_DUMB_INIT),y)\n> +DOCKER_ENGINE_INIT = dumb-init\n> +else\n> +DOCKER_ENGINE_INIT = tini\n> +endif\n> +\n>  endif\n>  \n>  ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_EXPERIMENTAL),y)\n> @@ -119,6 +126,10 @@ define DOCKER_ENGINE_INSTALL_TARGET_CMDS\n>  \t$(foreach target,$(DOCKER_ENGINE_BUILD_TARGETS), \\\n>  \t\t$(INSTALL) -D -m 0755 $(@D)/bin/$(target) $(TARGET_DIR)/usr/bin/$(target)\n>  \t)\n> +\n> +\t$(if $(filter $(BR2_PACKAGE_DOCKER_ENGINE_DAEMON),y), \\\n> +\t\tln -fs $(DOCKER_ENGINE_INIT) $(TARGET_DIR)/usr/bin/docker-init\n> +\t)\n>  endef\n>  \n>  $(eval $(generic-package))\n>","headers":{"Return-Path":"<buildroot-bounces@busybox.net>","X-Original-To":["incoming@patchwork.ozlabs.org","buildroot@lists.busybox.net"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","buildroot@osuosl.org"],"Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=busybox.net\n\t(client-ip=140.211.166.137; helo=fraxinus.osuosl.org;\n\tenvelope-from=buildroot-bounces@busybox.net;\n\treceiver=<UNKNOWN>)","Received":["from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xyqjQ373fz9s2G\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 07:38:18 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 5C95689072;\n\tThu, 21 Sep 2017 21:38:16 +0000 (UTC)","from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id MQ813FApRnm4; Thu, 21 Sep 2017 21:38:14 +0000 (UTC)","from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 4176C8907E;\n\tThu, 21 Sep 2017 21:38:14 +0000 (UTC)","from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 2F91E1CEB50\n\tfor <buildroot@lists.busybox.net>;\n\tThu, 21 Sep 2017 21:38:12 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 2A4408A264\n\tfor <buildroot@lists.busybox.net>;\n\tThu, 21 Sep 2017 21:38:12 +0000 (UTC)","from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id KOuqGfZZTrIy for <buildroot@lists.busybox.net>;\n\tThu, 21 Sep 2017 21:38:10 +0000 (UTC)","from exchange.essensium.com (220.77.144.195.ipv4.evonet.be\n\t[195.144.77.220])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 8EFF58A262\n\tfor <buildroot@buildroot.org>; Thu, 21 Sep 2017 21:38:10 +0000 (UTC)","from [10.8.0.14] (10.3.7.11) by beleexch01.local.ess-mail.com\n\t(10.3.7.8) with Microsoft SMTP Server (TLS) id 15.0.847.32;\n\tThu, 21 Sep 2017 23:37:09 +0200"],"X-Virus-Scanned":["amavisd-new at osuosl.org","amavisd-new at osuosl.org"],"X-Greylist":"domain auto-whitelisted by SQLgrey-1.7.6","To":"Christian Stewart <christian@paral.in>, <buildroot@buildroot.org>","References":"<20170920030210.19446-1-christian@paral.in>\n\t<20170920030210.19446-4-christian@paral.in>","From":"Arnout Vandecappelle <arnout@mind.be>","Organization":"Essensium/Mind","Message-ID":"<859c9ec7-7a17-cfef-ac9f-8982d8f8c086@mind.be>","Date":"Thu, 21 Sep 2017 23:37:08 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170920030210.19446-4-christian@paral.in>","Content-Language":"en-GB","X-Originating-IP":"[10.3.7.11]","X-ClientProxiedBy":"beleexch01.local.ess-mail.com (10.3.7.8) To\n\tbeleexch01.local.ess-mail.com (10.3.7.8)","Cc":"thomas.petazzoni@free-electrons.com, geoff@infradead.org","Subject":"Re: [Buildroot] [PATCH 3/9] docker-engine: add support for init\n\tprocesses","X-BeenThere":"buildroot@busybox.net","X-Mailman-Version":"2.1.18-1","Precedence":"list","List-Id":"Discussion and development of buildroot <buildroot.busybox.net>","List-Unsubscribe":"<http://lists.busybox.net/mailman/options/buildroot>,\n\t<mailto:buildroot-request@busybox.net?subject=unsubscribe>","List-Archive":"<http://lists.busybox.net/pipermail/buildroot/>","List-Post":"<mailto:buildroot@busybox.net>","List-Help":"<mailto:buildroot-request@busybox.net?subject=help>","List-Subscribe":"<http://lists.busybox.net/mailman/listinfo/buildroot>,\n\t<mailto:buildroot-request@busybox.net?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"buildroot-bounces@busybox.net","Sender":"\"buildroot\" <buildroot-bounces@busybox.net>"}},{"id":1773172,"web_url":"http://patchwork.ozlabs.org/comment/1773172/","msgid":"<CA+h8R2pkz7=vpzbScAShZrdZU3=QDoKoPc7+iwVVP4vBiX=4JQ@mail.gmail.com>","list_archive_url":null,"date":"2017-09-21T23:09:40","subject":"Re: [Buildroot] [PATCH 3/9] docker-engine: add support for init\n\tprocesses","submitter":{"id":66856,"url":"http://patchwork.ozlabs.org/api/people/66856/","name":"Christian Stewart","email":"christian@paral.in"},"content":"Hi Arnout,\n\nI marked this series as RFC on patchwork, just because there are a\ncouple of fixes I have applied and will respin after people are done\nreviewing.\n\nOn Thu, Sep 21, 2017 at 10:37 PM, Arnout Vandecappelle <arnout@mind.be> wrote:\n>  On my Debian system there is no docker-init but I don't get this warning when\n> starting docker...\n\nThis is likely because Docker has changed since I wrote this patch\noriginally, which was against a version 4 versions ago around 6 months\nago.\n\n>  Upstream URL is not needed here, only in the package itself.\n\nInteresting, I put it there because for some reason I remember seeing\nthe upstream URL in the Config.in for other packages. Will remove.\n\n>  It might be useful to add some help text that indicates the difference between\n> tini and dumb-init.\n\nFunctionally there is none, but the actual implementations are just\nslightly different by different authors. Tini is a bit newer but\nbacked by a less trusted source while dumb-init is old and backed by\nYelp. For some reason Tini is used by the docker official\ndistribution.\n\nBest,\nChristian","headers":{"Return-Path":"<buildroot-bounces@busybox.net>","X-Original-To":["incoming@patchwork.ozlabs.org","buildroot@lists.busybox.net"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","buildroot@osuosl.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=busybox.net\n\t(client-ip=140.211.166.133; helo=hemlock.osuosl.org;\n\tenvelope-from=buildroot-bounces@busybox.net;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=paral-in.20150623.gappssmtp.com\n\theader.i=@paral-in.20150623.gappssmtp.com header.b=\"iTvd+sV6\";\n\tdkim-atps=neutral"],"Received":["from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xyslX4MhQz9t33\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 09:10:15 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 8B98F86C3C;\n\tThu, 21 Sep 2017 23:10:10 +0000 (UTC)","from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id naMsX23T9QAw; Thu, 21 Sep 2017 23:10:08 +0000 (UTC)","from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 3F50E866DB;\n\tThu, 21 Sep 2017 23:10:08 +0000 (UTC)","from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 6B4C11C0674\n\tfor <buildroot@lists.busybox.net>;\n\tThu, 21 Sep 2017 23:10:06 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 656C72FE70\n\tfor <buildroot@lists.busybox.net>;\n\tThu, 21 Sep 2017 23:10:06 +0000 (UTC)","from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id CN3IMqZSkxVT for <buildroot@lists.busybox.net>;\n\tThu, 21 Sep 2017 23:10:05 +0000 (UTC)","from mail-lf0-f49.google.com (mail-lf0-f49.google.com\n\t[209.85.215.49])\n\tby silver.osuosl.org (Postfix) with ESMTPS id CDA722FE14\n\tfor <buildroot@buildroot.org>; Thu, 21 Sep 2017 23:10:04 +0000 (UTC)","by mail-lf0-f49.google.com with SMTP id a18so7139884lfl.13\n\tfor <buildroot@buildroot.org>; Thu, 21 Sep 2017 16:10:04 -0700 (PDT)","from mail-lf0-f43.google.com (mail-lf0-f43.google.com.\n\t[209.85.215.43]) by smtp.gmail.com with ESMTPSA id\n\tq18sm527774lja.19.2017.09.21.16.10.01 for <buildroot@buildroot.org>\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tThu, 21 Sep 2017 16:10:01 -0700 (PDT)","by mail-lf0-f43.google.com with SMTP id 80so7180101lfy.4\n\tfor <buildroot@buildroot.org>; Thu, 21 Sep 2017 16:10:01 -0700 (PDT)","by 10.179.65.186 with HTTP; Thu, 21 Sep 2017 16:09:40 -0700 (PDT)"],"X-Virus-Scanned":["amavisd-new at osuosl.org","amavisd-new at osuosl.org"],"X-Greylist":"from auto-whitelisted by SQLgrey-1.7.6","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=paral-in.20150623.gappssmtp.com; s=20150623;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=ypfrJdD6XorQ6mTkRhuVX/kRjkN/91xctpb3dDeUHYM=;\n\tb=iTvd+sV6IDjE1gHq9onEjkoi4B9IaTkPu2iDwuemsxCd8IXUh6cbS3tnwSdGbrI6Lf\n\twro4DrUd/RX/M+cwlHT2bKqtJdNWGoNMYJmkGSdfU025EFfwpbUxW8aQnoMKtByBjml2\n\tVhdLFjWctRVCG2GlsWAsoyZW131U0Q//NCxMMOEQb/tooFnkw8DbxIZpDBFURHJ3Giaq\n\t5JQvi998T4zn6gT+fdzx/cke0bAc+kstqaGrkStn2vTEoVqBA6bMoUrWO3jtNZOpBSif\n\tu1SeqcRVAZmPbKgc4uzTLUqxFmnoXDB/tAEGeIkuGlDXu2yn0VozGYSv84Zfug0bSbZm\n\tMYfA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=ypfrJdD6XorQ6mTkRhuVX/kRjkN/91xctpb3dDeUHYM=;\n\tb=TkE/pxJ5HOH1Rhahz5uiIpOdBIsNVnBJi2p6ha0F/mBZRcYbW3DBsFe4YM4ax8aNPZ\n\tar2S3p+15Z67XH2QDwYurtJKiYg7PiRaAsxPsfVLdaPer51gt3NR4DttG+t5ghjsZOoS\n\tfaV7y0NPREjg+tAmXsiGA7dgS062pDM0UzN9epH7yZip6V5KjIgZjG8zwatZu7w5ZL59\n\tU7jANTWYIew8Lw13eUVmfLzDXZ3g6QT1aFEXlX8X+iURdZltuIDx80m6yKYMGmvexP09\n\t0zfCJJCCz1hhLh+3qZyBPS7iUeHFu+qd/++kr/cSqJQ4HM4g5q8VGpXJO6P7V0/4o5/9\n\tEMJQ==","X-Gm-Message-State":"AHPjjUiMpqyrGlFWGqjm+kIrKU+BhJp4eioEbugg9yleZZxLYPUIgnwh\n\tXlfmH6nWJ4qCithzfKjeFAg192NX","X-Received":["by 10.46.32.148 with SMTP id g20mr1651053lji.62.1506035402223;\n\tThu, 21 Sep 2017 16:10:02 -0700 (PDT)","by 10.25.148.145 with SMTP id o17mr1327347lfk.82.1506035400670; \n\tThu, 21 Sep 2017 16:10:00 -0700 (PDT)"],"X-Google-Smtp-Source":"AOwi7QCqbnJhtAaj5MivPLB7Ultzh/KijATTLNuuww+JVYIGLdDQpiQzI4Ia/tTesBdAvhgMNmT9ow9DNQWyA2saP1Y=","MIME-Version":"1.0","In-Reply-To":"<859c9ec7-7a17-cfef-ac9f-8982d8f8c086@mind.be>","References":"<20170920030210.19446-1-christian@paral.in>\n\t<20170920030210.19446-4-christian@paral.in>\n\t<859c9ec7-7a17-cfef-ac9f-8982d8f8c086@mind.be>","From":"Christian Stewart <christian@paral.in>","Date":"Fri, 22 Sep 2017 00:09:40 +0100","X-Gmail-Original-Message-ID":"<CA+h8R2pkz7=vpzbScAShZrdZU3=QDoKoPc7+iwVVP4vBiX=4JQ@mail.gmail.com>","Message-ID":"<CA+h8R2pkz7=vpzbScAShZrdZU3=QDoKoPc7+iwVVP4vBiX=4JQ@mail.gmail.com>","To":"Arnout Vandecappelle <arnout@mind.be>","Cc":"Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,\n\tGeoff Levand <geoff@infradead.org>,\n\tBuildroot Mailing List <buildroot@buildroot.org>","Subject":"Re: [Buildroot] [PATCH 3/9] docker-engine: add support for init\n\tprocesses","X-BeenThere":"buildroot@busybox.net","X-Mailman-Version":"2.1.18-1","Precedence":"list","List-Id":"Discussion and development of buildroot <buildroot.busybox.net>","List-Unsubscribe":"<http://lists.busybox.net/mailman/options/buildroot>,\n\t<mailto:buildroot-request@busybox.net?subject=unsubscribe>","List-Archive":"<http://lists.busybox.net/pipermail/buildroot/>","List-Post":"<mailto:buildroot@busybox.net>","List-Help":"<mailto:buildroot-request@busybox.net?subject=help>","List-Subscribe":"<http://lists.busybox.net/mailman/listinfo/buildroot>,\n\t<mailto:buildroot-request@busybox.net?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"buildroot-bounces@busybox.net","Sender":"\"buildroot\" <buildroot-bounces@busybox.net>"}}]