All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Stewart <christian@paral.in>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v3 3/6] docker-engine: add support for init processes
Date: Sat, 14 Jul 2018 18:07:29 -0700	[thread overview]
Message-ID: <20180715010732.21765-9-christian@paral.in> (raw)
In-Reply-To: <20180715010732.21765-1-christian@paral.in>

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 <christian@paral.in>
---
 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)" \
-- 
2.16.1

  parent reply	other threads:[~2018-07-15  1:07 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-15  1:07 [Buildroot] [PATCH 1/6] tini: new package Christian Stewart
2018-07-15  1:07 ` [Buildroot] [PATCH 2/6] dumb-init: " Christian Stewart
2018-07-15  1:07 ` [Buildroot] [PATCH 3/6] docker-engine: add support for init processes Christian Stewart
2018-07-15  1:07 ` [Buildroot] [PATCH 4/6] runc: bump to 69663f0b Christian Stewart
2018-07-15  1:07 ` [Buildroot] [PATCH 5/6] docker-containerd: bump to v1.1.1 Christian Stewart
2018-07-15  1:07 ` [Buildroot] [PATCH 6/6] docker-engine: split into docker-{cli, engine}, bump v2018.06-ce-rc3 Christian Stewart
2018-07-15  1:07 ` [Buildroot] [PATCH v3 1/6] tini: new package Christian Stewart
2018-07-15 14:30   ` Matthew Weber
2018-07-15 16:01   ` Yann E. MORIN
2018-07-15 19:26     ` Christian Stewart
2018-07-15 19:58       ` Yann E. MORIN
2018-07-16 22:19       ` Arnout Vandecappelle
2018-07-15  1:07 ` [Buildroot] [PATCH v3 2/6] dumb-init: " Christian Stewart
2018-07-15  1:07 ` Christian Stewart [this message]
2018-07-15  1:07 ` [Buildroot] [PATCH v3 4/6] runc: bump to 69663f0b Christian Stewart
2018-07-15  1:07 ` [Buildroot] [PATCH v3 5/6] docker-containerd: bump to v1.1.1 Christian Stewart
2018-07-15  1:07 ` [Buildroot] [PATCH v3 6/6] docker-engine: split into docker-{cli, engine}, bump v2018.06-ce-rc3 Christian Stewart
2018-07-15 15:57 ` [Buildroot] [PATCH 1/6] tini: new package Yann E. MORIN
2018-08-10 13:53 ` Matthew Weber
2018-08-10 22:36   ` Christian Stewart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180715010732.21765-9-christian@paral.in \
    --to=christian@paral.in \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.