All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 03/12] docker-engine: add support for init processes
Date: Sat, 21 Oct 2017 15:51:39 +0200	[thread overview]
Message-ID: <20171021135139.GC7022@scaer> (raw)
In-Reply-To: <20171019002257.27646-3-christian@paral.in>

Christian, All,

On 2017-10-18 20:22 -0400, Christian Stewart spake thusly:
> 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 | 11 +++++++++++
>  2 files changed, 37 insertions(+)
> 
> diff --git a/package/docker-engine/Config.in b/package/docker-engine/Config.in
> index 05670a716e..7d9a87f7bb 100644
> --- a/package/docker-engine/Config.in
> +++ b/package/docker-engine/Config.in
> @@ -33,6 +33,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 8928f072e7..a2776ed78c 100644
> --- a/package/docker-engine/docker-engine.mk
> +++ b/package/docker-engine/docker-engine.mk
> @@ -50,6 +50,13 @@ endif
>  ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DAEMON),y)
>  DOCKER_ENGINE_BUILD_TAGS += daemon
>  DOCKER_ENGINE_BUILD_TARGETS += dockerd
> +
> +ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_INIT_DUMB_INIT),y)
> +DOCKER_ENGINE_INIT = dumb-init
> +else
> +DOCKER_ENGINE_INIT = tini
> +endif
> +
>  endif
>  
>  ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_EXPERIMENTAL),y)
> @@ -119,6 +126,10 @@ define DOCKER_ENGINE_INSTALL_TARGET_CMDS
>  	$(foreach target,$(DOCKER_ENGINE_BUILD_TARGETS), \
>  		$(INSTALL) -D -m 0755 $(@D)/bin/$(target) $(TARGET_DIR)/usr/bin/$(target)
>  	)
> +
> +	$(if $(filter $(BR2_PACKAGE_DOCKER_ENGINE_DAEMON),y), \

Why not:

    $(if $(BR2_PACKAGE_DOCKER_ENGINE_DAEMON),\
        ln -fs $(DOCKER_ENGINE_INIT) $(TARGET_DIR)/usr/bin/docker-init
    )

Regards,
Yann E. MORIN.

> +		ln -fs $(DOCKER_ENGINE_INIT) $(TARGET_DIR)/usr/bin/docker-init
> +	)
>  endef
>  
>  $(eval $(generic-package))
> -- 
> 2.13.6
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2017-10-21 13:51 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-19  0:22 [Buildroot] [PATCH 01/12] dumb-init: new package Christian Stewart
2017-10-19  0:22 ` [Buildroot] [PATCH 02/12] tini: " Christian Stewart
2017-10-21 13:49   ` Thomas Petazzoni
2017-10-24  3:06     ` Christian Stewart
2017-10-19  0:22 ` [Buildroot] [PATCH 03/12] docker-engine: add support for init processes Christian Stewart
2017-10-21 13:51   ` Yann E. MORIN [this message]
2017-10-24  3:28     ` Christian Stewart
2017-10-21 13:51   ` Thomas Petazzoni
2017-10-24  3:29     ` Christian Stewart
2017-10-24 21:31       ` Arnout Vandecappelle
2017-10-24 23:55         ` Christian Stewart
2017-10-19  0:22 ` [Buildroot] [PATCH 04/12] docker-engine: select static for tini and dumb-init Christian Stewart
2017-10-19  0:22 ` [Buildroot] [PATCH 05/12] docker-proxy: new package Christian Stewart
2017-10-19  0:22 ` [Buildroot] [PATCH 06/12] docker-engine: add dependency on docker-proxy Christian Stewart
2017-10-19  0:22 ` [Buildroot] [PATCH 07/12] go: bump version to 1.9 Christian Stewart
2017-10-19  3:50   ` Baruch Siach
2017-10-19  8:19   ` Thomas Petazzoni
2017-10-19 16:15     ` Christian Stewart
2017-10-22 10:18   ` Thomas Petazzoni
2017-10-19  0:22 ` [Buildroot] [PATCH 08/12] runc: bump to v1.0.0-rc4 Christian Stewart
2017-10-22 10:23   ` Thomas Petazzoni
2017-10-19  0:22 ` [Buildroot] [PATCH 09/12] docker-containerd: bump to 3addd84 Christian Stewart
2017-10-19  0:22 ` [Buildroot] [PATCH 10/12] docker-proxy: bump to 9647f99 Christian Stewart
2017-10-19  0:22 ` [Buildroot] [PATCH 11/12] docker-engine: bump to v17.07.0-ce Christian Stewart
2017-10-19  0:22 ` [Buildroot] [PATCH 12/12] docker-engine: don't link against libsystemd without systemd Christian Stewart
2017-10-19 14:04 ` [Buildroot] [PATCH 01/12] dumb-init: new package Arnout Vandecappelle
2017-10-19 16:10   ` Christian Stewart
2017-10-21 13:50 ` Arnout Vandecappelle
2017-10-24  3:07   ` 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=20171021135139.GC7022@scaer \
    --to=yann.morin.1998@free.fr \
    --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.