From patchwork Sun Jul 15 01:07:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Stewart X-Patchwork-Id: 944027 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=paral.in Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=paral-in.20150623.gappssmtp.com header.i=@paral-in.20150623.gappssmtp.com header.b="xZnETI+C"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41SpWt5CQ3z9s3R for ; Sun, 15 Jul 2018 11:15:54 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3F64084A0F; Sun, 15 Jul 2018 01:15:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AP4rpXzaMlJT; Sun, 15 Jul 2018 01:15:50 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 855E4849B8; Sun, 15 Jul 2018 01:15:50 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 007581C002D for ; Sun, 15 Jul 2018 01:15:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id F1E66836E6 for ; Sun, 15 Jul 2018 01:15:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OS1TvuJ7qmum for ; Sun, 15 Jul 2018 01:15:48 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qk0-f178.google.com (mail-qk0-f178.google.com [209.85.220.178]) by whitealder.osuosl.org (Postfix) with ESMTPS id 72B4B836E5 for ; Sun, 15 Jul 2018 01:15:48 +0000 (UTC) Received: by mail-qk0-f178.google.com with SMTP id o2-v6so18986157qkc.13 for ; Sat, 14 Jul 2018 18:15:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paral-in.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=jGiW3WjiVfSE/7RKoDlNUb8tyrFWT4H0aMZv69salgk=; b=xZnETI+Cm40mr9C4DMGoikP7pkSHe7pyT8Ss6rPrj48AQ2Lk28TCGLCQqjBM3Yrr7k RdiQOFJlBeeKzKu12HPPIZBU7/+wFG7wXZoEQWRTeJ1GTpTy6TYK9W1SzOGMtxpog/Mh Pk42Cly6O6NrHMPJAAaQTW/20AvFL5g7JZJCFttWgPmHesadCa7oxW54uaKlwLDAr5Jw FwNdrpwZ2+T45CX++j0cNh62zAOU71hbJO2XLM9zNvY9eLVHWgjdUfC0fmeQJ9qN3Lp/ yb3T6griKv6lCoi28p7UU6iTum7KuV/TpJbuRnkif1j+cxyAAptJPSXX2ABjbRt6erSA esRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=jGiW3WjiVfSE/7RKoDlNUb8tyrFWT4H0aMZv69salgk=; b=NDBQ3ykAM17gI+Z7WkIyNEzDAW8MGGrxwupzxWjVbRJH1wDATuvfQ5NQsHjWe9a/qS sUGQmVPqccsuGOXEhgPJZWxwTEsWp5hNW+NZrlgTphAfHxIyt3kDpxld0SIzoT9KrfV4 y95JTMkOPm/QTQIVNH3JYFQfarXaK3z15+LAsAKjoABs+3lYnW1SejYHJyntup+Wgozs t6gtqBZQnl0JYmQdTs+oqC2dCdRdfxF2CDT0rcE8dfY8TXfQ3ifUYC+bAl/OZe1NXgxJ KqDQRedGHuLwsNsfBmP0O6M6vxB2yVIuhlC0S/HMuHDhpYaNBr7gYB9iSpXWynWTRrrC YT/w== X-Gm-Message-State: AOUpUlEohEB3gZJYcSYs1l3TFZy4mkVJOXe9Fm3cYA7grk06vqhkQDKN BtrESoodf18cQTsOFSZMPMHuKTWi X-Google-Smtp-Source: AAOMgpfxyQNqJnTGaMCJvJ4sYBAclntNLk4KygGZs/ICqHvUzIlzSxJYf9lbpG4vnfHxNQFb5a0xFA== X-Received: by 2002:a37:6b03:: with SMTP id g3-v6mr9792830qkc.107.1531616871618; Sat, 14 Jul 2018 18:07:51 -0700 (PDT) Received: from localhost.localdomain ([165.254.106.58]) by smtp.gmail.com with ESMTPSA id a17-v6sm1867480qkb.62.2018.07.14.18.07.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Jul 2018 18:07:50 -0700 (PDT) From: Christian Stewart To: buildroot@buildroot.org Date: Sat, 14 Jul 2018 18:07:29 -0700 Message-Id: <20180715010732.21765-9-christian@paral.in> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180715010732.21765-1-christian@paral.in> References: <20180715010732.21765-1-christian@paral.in> Subject: [Buildroot] [PATCH v3 3/6] docker-engine: add support for init processes X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Stewart , Thomas Petazzoni , Angelo Compagnucci MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" When a docker container is run with the --init flag, the Docker engine uses the docker-init binary as PID 1 inside the container. This is necessary in may cases to avoid issues with signal handling, zombie processes, and other quirks when running as PID 1. The docker-init binary is backed by tini on default, but optionally can be changed to docker-init by user preference. Furthermore, this patch fixes the following Docker error: dockerd: level=warning msg="failed to retrieve docker-init version" Signed-off-by: Christian Stewart --- package/docker-engine/Config.in | 26 ++++++++++++++++++++++++++ package/docker-engine/docker-engine.mk | 6 ++++++ 2 files changed, 32 insertions(+) diff --git a/package/docker-engine/Config.in b/package/docker-engine/Config.in index 8feb11b48c..a76940b6c0 100644 --- a/package/docker-engine/Config.in +++ b/package/docker-engine/Config.in @@ -34,6 +34,32 @@ config BR2_PACKAGE_DOCKER_ENGINE_STATIC_CLIENT if BR2_PACKAGE_DOCKER_ENGINE_DAEMON +choice + bool "docker-init to use" + default BR2_PACKAGE_DOCKER_ENGINE_INIT_TINI + help + The docker engine uses a minimal init process as PID 1 + inside containers. There are several implementations + of this init process. + +config BR2_PACKAGE_DOCKER_ENGINE_INIT_TINI + bool "tini" + select BR2_PACKAGE_TINI + help + Use Tini as the container init process. + + https://github.com/krallin/tini + +config BR2_PACKAGE_DOCKER_ENGINE_INIT_DUMB_INIT + bool "dumb-init" + select BR2_PACKAGE_DUMB_INIT + help + Use dumb-init as the container init process. + + https://github.com/Yelp/dumb-init + +endchoice + config BR2_PACKAGE_DOCKER_ENGINE_DRIVER_BTRFS bool "btrfs filesystem driver" depends on BR2_USE_MMU # btrfs-progs diff --git a/package/docker-engine/docker-engine.mk b/package/docker-engine/docker-engine.mk index ba84b4cf0a..a85f4b5784 100644 --- a/package/docker-engine/docker-engine.mk +++ b/package/docker-engine/docker-engine.mk @@ -63,6 +63,12 @@ endif DOCKER_ENGINE_INSTALL_BINS = $(notdir $(DOCKER_ENGINE_BUILD_TARGETS)) +ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_INIT_DUMB_INIT),y) +DOCKER_ENGINE_INSTALL_BINS += dumb-init +else +DOCKER_ENGINE_INSTALL_BINS += tini +endif + define DOCKER_ENGINE_RUN_AUTOGEN cd $(@D) && \ GITCOMMIT="$$(echo $(DOCKER_ENGINE_COMMIT) | head -c7)" \