* [Buildroot] [PATCH v1 1/1] tini: new package
@ 2018-08-10 18:42 Christian Stewart
2018-08-10 19:55 ` Thomas Petazzoni
2018-08-14 13:57 ` Thomas Petazzoni
0 siblings, 2 replies; 6+ messages in thread
From: Christian Stewart @ 2018-08-10 18:42 UTC (permalink / raw)
To: buildroot
Tini is a minimal init process to act as PID 1 for containers.
Note: it is not necessary to compile Tini statically for many non-docker
container environments, and Docker now statically links to Tini internally (as
of 1.13).
Tested-by: Matt Weber <matthew.weber@rockwellcollins.com>
Signed-off-by: Christian Stewart <christian@paral.in>
---
package/Config.in | 1 +
package/tini/Config.in | 16 ++++++++++++++++
package/tini/tini.hash | 3 +++
package/tini/tini.mk | 37 +++++++++++++++++++++++++++++++++++++
4 files changed, 57 insertions(+)
create mode 100644 package/tini/Config.in
create mode 100644 package/tini/tini.hash
create mode 100644 package/tini/tini.mk
diff --git a/package/Config.in b/package/Config.in
index f5a17492c7..fa8e36747d 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1996,6 +1996,7 @@ comment "Utilities"
source "package/sudo/Config.in"
source "package/terminology/Config.in"
source "package/time/Config.in"
+ source "package/tini/Config.in"
source "package/tmux/Config.in"
source "package/which/Config.in"
source "package/xmlstarlet/Config.in"
diff --git a/package/tini/Config.in b/package/tini/Config.in
new file mode 100644
index 0000000000..235fc1a8fb
--- /dev/null
+++ b/package/tini/Config.in
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_TINI
+ bool "tini"
+ help
+ tini is a simple but valid init binary to
+ act as PID 1 for containers.
+
+ https://github.com/krallin/tini
+
+if BR2_PACKAGE_TINI
+
+config BR2_PACKAGE_TINI_MINIMAL
+ bool "build minimal variant"
+ help
+ Disables argument parsing and verbose output.
+
+endif
diff --git a/package/tini/tini.hash b/package/tini/tini.hash
new file mode 100644
index 0000000000..34f919f068
--- /dev/null
+++ b/package/tini/tini.hash
@@ -0,0 +1,3 @@
+# Locally computed
+sha256 e5f46bca81266bdd511cf08018d66866870531794569c04f9b45f50dd23c28b0 LICENSE
+sha256 1097675352d6317b547e73f9dc7c6839fd0bb0d96dafc2e5c95506bb324049a2 tini-v0.18.0.tar.gz
diff --git a/package/tini/tini.mk b/package/tini/tini.mk
new file mode 100644
index 0000000000..f4ec63020b
--- /dev/null
+++ b/package/tini/tini.mk
@@ -0,0 +1,37 @@
+################################################################################
+#
+# tini
+#
+################################################################################
+
+TINI_VERSION = v0.18.0
+TINI_SITE = $(call github,krallin,tini,$(TINI_VERSION))
+
+TINI_LICENSE = MIT
+TINI_LICENSE_FILES = LICENSE
+
+TINI_CFLAGS = $(TARGET_CFLAGS) \
+ -DTINI_VERSION=\"$(TINI_VERSION)\" \
+ -DTINI_GIT=\"\"
+
+ifeq ($(BR2_PACKAGE_TINI_MINIMAL),y)
+TINI_CFLAGS += -DTINI_MINIMAL
+endif
+
+define TINI_CONFIGURE_CMDS
+ printf "#pragma once\n" > $(@D)/src/tiniConfig.h
+endef
+
+define TINI_BUILD_CMDS
+ mkdir -p $(@D)/bin
+ $(TARGET_CC) \
+ $(TINI_CFLAGS) \
+ -o $(@D)/bin/tini $(@D)/src/tini.c
+endef
+
+define TINI_INSTALL_TARGET_CMDS
+ $(INSTALL) -D -m 0755 $(@D)/bin/tini $(TARGET_DIR)/usr/bin/tini
+endef
+
+# Tini's CMakeLists.txt is not suitable for Buildroot.
+$(eval $(generic-package))
--
2.16.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH v1 1/1] tini: new package
2018-08-10 18:42 [Buildroot] [PATCH v1 1/1] tini: new package Christian Stewart
@ 2018-08-10 19:55 ` Thomas Petazzoni
2018-08-10 22:11 ` Christian Stewart
2018-08-14 13:57 ` Thomas Petazzoni
1 sibling, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2018-08-10 19:55 UTC (permalink / raw)
To: buildroot
Hello,
On Fri, 10 Aug 2018 11:42:55 -0700, Christian Stewart wrote:
> Note: it is not necessary to compile Tini statically for many non-docker
> container environments, and Docker now statically links to Tini internally (as
> of 1.13).
What does "Docker now statically links to Tiny internally" mean ?
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH v1 1/1] tini: new package
2018-08-10 19:55 ` Thomas Petazzoni
@ 2018-08-10 22:11 ` Christian Stewart
2018-08-10 22:17 ` Thomas Petazzoni
0 siblings, 1 reply; 6+ messages in thread
From: Christian Stewart @ 2018-08-10 22:11 UTC (permalink / raw)
To: buildroot
Hi Thomas,
On Fri, Aug 10, 2018 at 12:55 PM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> What does "Docker now statically links to Tiny internally" mean ?
I suppose the commit note is not clear. I am basically saying that we
do not need to statically link Tini, unlike previous revisions of this
commit. The intent of this package is no longer to satisfy the
docker-init requirement, but instead to just provide the "tini" binary
in the target environment, dynamically linked or otherwise.
According to https://github.com/krallin/tini - NOTE: If you are using
Docker 1.13 or greater, Tini is included in Docker itself. This
includes all versions of Docker CE. To enable Tini, just pass the
--init flag to docker run.
This was the source of the original reasoning of the note.
~ Christian
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH v1 1/1] tini: new package
2018-08-10 22:11 ` Christian Stewart
@ 2018-08-10 22:17 ` Thomas Petazzoni
2018-08-10 23:33 ` Matthew Weber
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2018-08-10 22:17 UTC (permalink / raw)
To: buildroot
Hello,
On Fri, 10 Aug 2018 15:11:11 -0700, Christian Stewart wrote:
> On Fri, Aug 10, 2018 at 12:55 PM Thomas Petazzoni
> <thomas.petazzoni@bootlin.com> wrote:
> >
> > What does "Docker now statically links to Tiny internally" mean ?
>
> I suppose the commit note is not clear. I am basically saying that we
> do not need to statically link Tini, unlike previous revisions of this
> commit. The intent of this package is no longer to satisfy the
> docker-init requirement, but instead to just provide the "tini" binary
> in the target environment, dynamically linked or otherwise.
Why did the requirement change ?
> According to https://github.com/krallin/tini - NOTE: If you are using
> Docker 1.13 or greater, Tini is included in Docker itself. This
> includes all versions of Docker CE. To enable Tini, just pass the
> --init flag to docker run.
If Tini is included in Docker itself, why do we need a package for it ?
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH v1 1/1] tini: new package
2018-08-10 22:17 ` Thomas Petazzoni
@ 2018-08-10 23:33 ` Matthew Weber
0 siblings, 0 replies; 6+ messages in thread
From: Matthew Weber @ 2018-08-10 23:33 UTC (permalink / raw)
To: buildroot
Thomas,
On Fri, Aug 10, 2018 at 5:17 PM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> Hello,
>
> On Fri, 10 Aug 2018 15:11:11 -0700, Christian Stewart wrote:
>
> > On Fri, Aug 10, 2018 at 12:55 PM Thomas Petazzoni
> > <thomas.petazzoni@bootlin.com> wrote:
> > >
> > > What does "Docker now statically links to Tiny internally" mean ?
> >
> > I suppose the commit note is not clear. I am basically saying that we
> > do not need to statically link Tini, unlike previous revisions of this
> > commit. The intent of this package is no longer to satisfy the
> > docker-init requirement, but instead to just provide the "tini" binary
> > in the target environment, dynamically linked or otherwise.
>
> Why did the requirement change ?
Tini can be used for cases where you do a basic container and the
filesystem isn't isolated from the host. Thus no need for static
building of the init process.
>
> > According to https://github.com/krallin/tini - NOTE: If you are using
> > Docker 1.13 or greater, Tini is included in Docker itself. This
> > includes all versions of Docker CE. To enable Tini, just pass the
> > --init flag to docker run.
>
> If Tini is included in Docker itself, why do we need a package for it ?
Basic LXC based containers can use it when are doing an abbreviated
init sequence for a container start.
Matt
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH v1 1/1] tini: new package
2018-08-10 18:42 [Buildroot] [PATCH v1 1/1] tini: new package Christian Stewart
2018-08-10 19:55 ` Thomas Petazzoni
@ 2018-08-14 13:57 ` Thomas Petazzoni
1 sibling, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2018-08-14 13:57 UTC (permalink / raw)
To: buildroot
Hello,
On Fri, 10 Aug 2018 11:42:55 -0700, Christian Stewart wrote:
> Tini is a minimal init process to act as PID 1 for containers.
>
> Note: it is not necessary to compile Tini statically for many non-docker
> container environments, and Docker now statically links to Tini internally (as
> of 1.13).
>
> Tested-by: Matt Weber <matthew.weber@rockwellcollins.com>
> Signed-off-by: Christian Stewart <christian@paral.in>
> ---
> package/Config.in | 1 +
> package/tini/Config.in | 16 ++++++++++++++++
> package/tini/tini.hash | 3 +++
> package/tini/tini.mk | 37 +++++++++++++++++++++++++++++++++++++
> 4 files changed, 57 insertions(+)
> create mode 100644 package/tini/Config.in
> create mode 100644 package/tini/tini.hash
> create mode 100644 package/tini/tini.mk
The entry to the DEVELOPERS file was missing, so I've added it, and
applied.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-08-14 13:57 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-10 18:42 [Buildroot] [PATCH v1 1/1] tini: new package Christian Stewart
2018-08-10 19:55 ` Thomas Petazzoni
2018-08-10 22:11 ` Christian Stewart
2018-08-10 22:17 ` Thomas Petazzoni
2018-08-10 23:33 ` Matthew Weber
2018-08-14 13:57 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox