Skip to contentSkip to conversation

tini: new package

PATCH New Christian Stewart 4 participants 20 messages Jul 15, 2018 – Aug 10, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/6 tini: new package

Tini is a minimal init process to act as PID 1 for containers.

Tini can be used to satisfy docker-engine's docker-init binary requirement.

---

Changes since v2:

- Upgraded to v0.17.0
- Added hash for license file

---
 package/Config.in      |  1 +
 package/tini/Config.in | 16 ++++++++++++++++
 package/tini/tini.hash |  3 +++
 package/tini/tini.mk   | 35 +++++++++++++++++++++++++++++++++++
 4 files changed, 55 insertions(+)
 create mode 100644 package/tini/Config.in
 create mode 100644 package/tini/tini.hash
 create mode 100644 package/tini/tini.mk
package/Config.in +1 -0
index 20fe5ad8ff..9d657287cd 100644
@@ -1983,6 +1983,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"
package/tini/Config.in new file +16 -0
new file mode 100644
index 0000000000..235fc1a8fb
@@ -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
package/tini/tini.hash new file +3 -0
new file mode 100644
index 0000000000..c4f85c43b0
@@ -0,0 +1,3 @@
+# Locally computed
+sha256	5244691718f6856db74dcf6dbb3576a901e737f41412e7895747f0ccb4ccaff0	tini-v0.17.0.tar.gz
+sha256	e5f46bca81266bdd511cf08018d66866870531794569c04f9b45f50dd23c28b0	LICENSE
package/tini/tini.mk new file +35 -0
new file mode 100644
index 0000000000..9f9d986745
@@ -0,0 +1,35 @@
+################################################################################
+#
+# tini
+#
+################################################################################
+
+TINI_VERSION = v0.17.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=\"\"
+TINI_CFLAGS += -static
+
+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
+	$(TARGET_CC) \
+		$(TINI_CFLAGS) \
+		-o $(@D)/tini $(@D)/src/tini.c
+endef
+
+define TINI_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/tini $(TARGET_DIR)/usr/bin/tini
+endef
+
+# Tini's CMakeLists.txt is not suitable for Buildroot.
+$(eval $(generic-package))
Signature · 1 line
2.16.1
#1 lore raw

PATCH 2/6 dumb-init: new package

dumb-init is a minimal init process to act as PID 1 for containers.

Static compilation is used, as dumb-init will typically be executed inside a container.

dumb-init can satisfy docker-engine's docker-init requirement.

---

Changes since v1:

- Upgraded to v1.2.1
- Added license hash

---
 package/Config.in                |  1 +
 package/dumb-init/Config.in      |  7 +++++++
 package/dumb-init/dumb-init.hash |  3 +++
 package/dumb-init/dumb-init.mk   | 24 ++++++++++++++++++++++++
 4 files changed, 35 insertions(+)
 create mode 100644 package/dumb-init/Config.in
 create mode 100644 package/dumb-init/dumb-init.hash
 create mode 100644 package/dumb-init/dumb-init.mk
package/Config.in +1 -0
index 9d657287cd..2aeb8d0f10 100644
@@ -1968,6 +1968,7 @@ comment "Utilities"
 	source "package/crudini/Config.in"
 	source "package/dialog/Config.in"
 	source "package/dtach/Config.in"
+	source "package/dumb-init/Config.in"
 	source "package/easy-rsa/Config.in"
 	source "package/file/Config.in"
 	source "package/gnupg/Config.in"
package/dumb-init/Config.in new file +7 -0
new file mode 100644
index 0000000000..e817493605
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_DUMB_INIT
+	bool "dumb-init"
+	help
+	  dumb-init is a simple but valid init binary to
+	  act as PID 1 for containers.
+
+	  https://github.com/Yelp/dumb-init
package/dumb-init/dumb-init.hash new file +3 -0
new file mode 100644
index 0000000000..9e74ff5580
@@ -0,0 +1,3 @@
+# Locally computed
+sha256	56858088d9d6c911c227d196fcbfca06aff31fbe83e1519f9cabe5cf6f11b242	dumb-init-v1.2.1.tar.gz
+sha256	4d74123f166ad8f147e9939bfb451578db84823f22b48fd64b1086d3654a0149  LICENSE
package/dumb-init/dumb-init.mk new file +24 -0
new file mode 100644
index 0000000000..4ebbff1930
@@ -0,0 +1,24 @@
+################################################################################
+#
+# dumb-init
+#
+################################################################################
+
+DUMB_INIT_VERSION = v1.2.1
+DUMB_INIT_SITE = $(call github,Yelp,dumb-init,$(DUMB_INIT_VERSION))
+
+DUMB_INIT_LICENSE = MIT
+DUMB_INIT_LICENSE_FILES = LICENSE
+DUMB_INIT_CFLAGS += -static
+
+define DUMB_INIT_BUILD_CMDS
+	$(TARGET_CC) \
+		$(DUMB_INIT_CFLAGS) \
+		-o $(@D)/dumb-init $(@D)/dumb-init.c
+endef
+
+define DUMB_INIT_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/dumb-init $(TARGET_DIR)/usr/bin/dumb-init
+endef
+
+$(eval $(generic-package))
Signature · 1 line
2.16.1
#2 lore raw

PATCH 3/6 docker-engine: add support for init processes

In reply to Christian Stewart

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"

---
 package/docker-engine/Config.in        | 26 ++++++++++++++++++++++++++
 package/docker-engine/docker-engine.mk |  6 ++++++
 2 files changed, 32 insertions(+)
package/docker-engine/Config.in +26 -0
index 8feb11b48c..a76940b6c0 100644
@@ -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
package/docker-engine/docker-engine.mk +6 -0
index ba84b4cf0a..a85f4b5784 100644
@@ -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)" \
Signature · 1 line
2.16.1
#3 lore raw

PATCH 4/6 runc: bump to 69663f0b

In reply to Christian Stewart

This commit bumps runc to the requisite version for Docker 2018.06.

Added note about where runc version dependency is declared:

RUNC_VERSION = 69663f0bd4b60df09991c08812a60108003fa340

---
 package/runc/runc.hash | 2 +-
 package/runc/runc.mk   | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
package/runc/runc.hash +1 -1
index 3e188c5c79..d6bdfe24c7 100644
@@ -1,2 +1,2 @@
 # Locally computed
-sha256	b5c50d7d9a5f610d5424f96196efa306ec708fd9299302dd919545099c16b7c1	runc-9c2d8d184e5da67c95d601382adf14862e4f2228.tar.gz
+sha256	994a3a0447fcbf7e37614b02aa5604d2d6b9fdb41e6870d8d3ff1138ed6e61ef  runc-69663f0bd4b60df09991c08812a60108003fa340.tar.gz
package/runc/runc.mk +2 -1
index f1586f32b2..7f42c962f3 100644
@@ -4,7 +4,8 @@
 #
 ################################################################################
 
-RUNC_VERSION = 9c2d8d184e5da67c95d601382adf14862e4f2228
+# docker-engine/hack/dockerfile/install/runc.installer:4 RUNC_COMMIT=...
+RUNC_VERSION = 69663f0bd4b60df09991c08812a60108003fa340
 RUNC_SITE = $(call github,opencontainers,runc,$(RUNC_VERSION))
 RUNC_LICENSE = Apache-2.0
 RUNC_LICENSE_FILES = LICENSE
Signature · 1 line
2.16.1
#4 lore raw

PATCH 5/6 docker-containerd: bump to v1.1.1

In reply to Christian Stewart

This commit bumps docker-containerd to v1.1.1.

This is a requisite bump for the upgrade of docker-engine to 2018.06.

---
 package/docker-containerd/Config.in              | 12 ++++++++++++
 package/docker-containerd/docker-containerd.hash |  2 +-
 package/docker-containerd/docker-containerd.mk   | 18 +++++++++++++++---
 3 files changed, 28 insertions(+), 4 deletions(-)
package/docker-containerd/Config.in +12 -0
index 2f7bf71af1..851345f73e 100644
@@ -15,6 +15,18 @@ config BR2_PACKAGE_DOCKER_CONTAINERD
 
 	  https://github.com/docker/containerd
 
+if BR2_PACKAGE_DOCKER_CONTAINERD
+
+config BR2_PACKAGE_DOCKER_CONTAINERD_DRIVER_BTRFS
+	bool "btrfs snapshot driver"
+	depends on BR2_USE_MMU # btrfs-progs
+	depends on BR2_TOOLCHAIN_HAS_THREADS # btrfs-progs
+	select BR2_PACKAGE_BTRFS_PROGS
+	help
+	  Build the btrfs snapshot driver for containerd.
+
+endif
+
 comment "docker-containerd needs a toolchain w/ threads"
 	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
 	depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
package/docker-containerd/docker-containerd.hash +1 -1
index 992eb5b01a..6d5ed45589 100644
@@ -1,2 +1,2 @@
 # Computed locally
-sha256	da89086a7c643702a2ddecec67a45d3d8e4b0d610dd19036be63e6bd54cc1a85	docker-containerd-9048e5e50717ea4497b757314bad98ea3763c145.tar.gz
+sha256	2901e3f6113ea97850ec9ac5640db0273c7f10e887701f7da2cf3ae1a730934e  docker-containerd-v1.1.1.tar.gz
package/docker-containerd/docker-containerd.mk +15 -3
index 09e89f1aba..85dd6e1f71 100644
@@ -4,8 +4,9 @@
 #
 ################################################################################
 
-DOCKER_CONTAINERD_VERSION = 9048e5e50717ea4497b757314bad98ea3763c145
-DOCKER_CONTAINERD_SITE = $(call github,docker,containerd,$(DOCKER_CONTAINERD_VERSION))
+DOCKER_CONTAINERD_VERSION = v1.1.1
+DOCKER_CONTAINERD_COMMIT = d64c661f1d51c48782c9cec8fda7604785f93587
+DOCKER_CONTAINERD_SITE = $(call github,containerd,containerd,$(DOCKER_CONTAINERD_VERSION))
 DOCKER_CONTAINERD_LICENSE = Apache-2.0
 DOCKER_CONTAINERD_LICENSE_FILES = LICENSE.code
 
@@ -14,10 +15,21 @@ DOCKER_CONTAINERD_WORKSPACE = vendor
 DOCKER_CONTAINERD_LDFLAGS = \
 	-X github.com/docker/containerd.GitCommit=$(DOCKER_CONTAINERD_VERSION)
 
-DOCKER_CONTAINERD_BUILD_TARGETS = ctr containerd containerd-shim
+DOCKER_CONTAINERD_BUILD_TARGETS = cmd/ctr cmd/containerd cmd/containerd-shim
 
 DOCKER_CONTAINERD_INSTALL_BINS = containerd containerd-shim
 
+ifeq ($(BR2_PACKAGE_LIBSECCOMP),y)
+DOCKER_CONTAINERD_DEPENDENCIES += libseccomp
+DOCKER_CONTAINERD_TAGS += seccomp
+endif
+
+ifeq ($(BR2_PACKAGE_DOCKER_CONTAINERD_DRIVER_BTRFS),y)
+DOCKER_CONTAINERD_DEPENDENCIES += btrfs-progs
+else
+DOCKER_CONTAINERD_TAGS += no_btrfs
+endif
+
 define DOCKER_CONTAINERD_INSTALL_SYMLINKS
 	ln -fs runc $(TARGET_DIR)/usr/bin/docker-runc
 	ln -fs containerd-shim $(TARGET_DIR)/usr/bin/docker-containerd-shim
Signature · 1 line
2.16.1
#5 lore raw

PATCH 6/6 docker-engine: split into docker-{cli, engine}, bump v2018.06-ce-rc3

In reply to Christian Stewart

Docker upstream has split the Docker daemon and CLI into separate codebases:

- github.com/docker/docker-engine: daemon, remains in docker-engine
- github.com/docker/cli: cli, split into docker-cli and selected by engine

This commit splits the docker-engine package into docker-engine and docker-cli. Conveniently, the Docker project has begun maintaining two separate release-tagged repositories for the CLI and daemon as of v18.06-ce-rc1. Previous versions were tagged in a common "docker-ce" repository which makes compilation awkward for Buildroot, especially due to some limitations in the new Go package infrastructure.

Legacy flags are added to ease the transition:

- BR2_PACKAGE_DOCKER_ENGINE_STATIC_CLIENT=y -> BR2_PACKAGE_DOCKER_CLI_STATIC
- docker-engine selects docker-cli

Docker repositories "engine" and "cli" recently started tagging releases as recent as v18.06-ce-rc1, so we pull the latest tagged release v18.06-ce-rc3 and upgrade to v18.06-ce when it is released.

---
 Config.in.legacy                         |  9 +++++++++
 package/Config.in                        |  1 +
 package/docker-cli/Config.in             | 25 +++++++++++++++++++++++++
 package/docker-cli/docker-cli.hash       |  2 ++
 package/docker-cli/docker-cli.mk         | 29 +++++++++++++++++++++++++++++
 package/docker-engine/Config.in          |  7 +------
 package/docker-engine/docker-engine.hash |  2 +-
 package/docker-engine/docker-engine.mk   | 32 ++++++++++++++------------------
 8 files changed, 82 insertions(+), 25 deletions(-)
 create mode 100644 package/docker-cli/Config.in
 create mode 100644 package/docker-cli/docker-cli.hash
 create mode 100644 package/docker-cli/docker-cli.mk
Config.in.legacy +9 -0
index 9743ebd08f..4cf9d05b9c 100644
@@ -242,6 +242,15 @@ config BR2_GDB_VERSION_7_10
 ###############################################################################
 comment "Legacy options removed in 2018.05"
 
+config BR2_PACKAGE_DOCKER_ENGINE_STATIC_CLIENT
+	bool "docker-engine static client option renamed"
+	select BR2_LEGACY
+  select BR2_PACKAGE_DOCKER_CLI_STATIC
+	help
+	  For consistency reasons, the option
+	  BR2_PACKAGE_DOCKER_ENGINE_STATIC_CLIENT has been renamed to
+	  BR2_PACKAGE_DOCKER_CLI_STATIC
+
 config BR2_PACKAGE_MEDIAART_BACKEND_NONE
 	bool "libmediaart none backend option renamed"
 	select BR2_LEGACY
package/Config.in +1 -0
index 2aeb8d0f10..28c1452a0f 100644
@@ -2007,6 +2007,7 @@ menu "System tools"
 	source "package/dcron/Config.in"
 	source "package/ddrescue/Config.in"
 	source "package/debianutils/Config.in"
+	source "package/docker-cli/Config.in"
 	source "package/docker-compose/Config.in"
 	source "package/docker-containerd/Config.in"
 	source "package/docker-engine/Config.in"
package/docker-cli/Config.in new file +25 -0
new file mode 100644
index 0000000000..82c35c453d
@@ -0,0 +1,25 @@
+config BR2_PACKAGE_DOCKER_CLI
+	bool "docker-cli"
+	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
+	depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	help
+	  Docker is a platform to build, ship,
+	  and run applications as lightweight containers.
+
+	  https://github.com/docker/cli
+
+if BR2_PACKAGE_DOCKER_CLI
+
+config BR2_PACKAGE_DOCKER_CLI_STATIC
+	bool "build static client"
+	depends on !BR2_STATIC_LIBS
+	help
+	  Build a static docker client.
+
+endif
+
+comment "docker-cli needs a toolchain w/ threads"
+	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
+	depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
package/docker-cli/docker-cli.hash new file +2 -0
new file mode 100644
index 0000000000..92b821de36
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256	06a302b43d6a2110ca33808077ca025f4adf9992c32a3cebc5373ecc3cdd44a2  docker-cli-v18.06.0-ce-rc3.tar.gz
package/docker-cli/docker-cli.mk new file +29 -0
new file mode 100644
index 0000000000..f11a8b514e
@@ -0,0 +1,29 @@
+###############################################################################
+#
+# docker-cli
+#
+################################################################################
+
+DOCKER_CLI_VERSION = v18.06.0-ce-rc3
+DOCKER_CLI_SITE = $(call github,docker,cli,$(DOCKER_CLI_VERSION))
+DOCKER_CLI_WORKSPACE = gopath
+
+DOCKER_CLI_LICENSE = Apache-2.0
+DOCKER_CLI_LICENSE_FILES = LICENSE
+
+DOCKER_CLI_DEPENDENCIES = host-go host-pkgconf
+
+DOCKER_CLI_LDFLAGS = \
+	-X github.com/docker/cli/cli.GitCommit=$(DOCKER_CLI_VERSION) \
+	-X github.com/docker/cli/cli.Version=$(DOCKER_CLI_VERSION)
+
+ifeq ($(BR2_PACKAGE_DOCKER_CLI_STATIC),y)
+DOCKER_CLI_LDFLAGS += -extldflags '-static'
+endif
+
+DOCKER_CLI_TAGS = cgo autogen
+DOCKER_CLI_BUILD_TARGETS = cmd/docker
+
+DOCKER_CLI_INSTALL_BINS = $(notdir $(DOCKER_CLI_BUILD_TARGETS))
+
+$(eval $(golang-package))
package/docker-engine/Config.in +1 -6
index a76940b6c0..e1e8ce0065 100644
@@ -3,6 +3,7 @@ config BR2_PACKAGE_DOCKER_ENGINE
 	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
 	depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
 	depends on BR2_TOOLCHAIN_HAS_THREADS
+  select BR2_PACKAGE_DOCKER_CLI
 	help
 	  Docker is a platform to build, ship,
 	  and run applications as lightweight containers.
@@ -26,12 +27,6 @@ config BR2_PACKAGE_DOCKER_ENGINE_DAEMON
 config BR2_PACKAGE_DOCKER_ENGINE_EXPERIMENTAL
 	bool "build experimental features"
 
-config BR2_PACKAGE_DOCKER_ENGINE_STATIC_CLIENT
-	bool "build static client"
-	depends on !BR2_STATIC_LIBS
-	help
-	  Build a static docker client.
-
 if BR2_PACKAGE_DOCKER_ENGINE_DAEMON
 
 choice
package/docker-engine/docker-engine.hash +1 -1
index 6c0ed338a5..592f570a09 100644
@@ -1,2 +1,2 @@
 # Locally calculated
-sha256	4716df117d867b82ddab2e82395cd40aa3d0925a689eedcec8919729e4c9f121	docker-engine-v17.05.0-ce.tar.gz
+sha256	faf546bf0fdcf32d4f9ddbe67759fb39871dc9ea42bddffea23286fcdbf28842  docker-engine-v18.06.0-ce-rc3.tar.gz
package/docker-engine/docker-engine.mk +14 -18
index a85f4b5784..b251befa09 100644
@@ -4,25 +4,21 @@
 #
 ################################################################################
 
-DOCKER_ENGINE_VERSION = v17.05.0-ce
-DOCKER_ENGINE_COMMIT = 89658bed64c2a8fe05a978e5b87dbec409d57a0f
-DOCKER_ENGINE_SITE = $(call github,docker,docker,$(DOCKER_ENGINE_VERSION))
+DOCKER_ENGINE_VERSION = v18.06.0-ce-rc3
+DOCKER_ENGINE_SITE = $(call github,docker,engine,$(DOCKER_ENGINE_VERSION))
 
 DOCKER_ENGINE_LICENSE = Apache-2.0
 DOCKER_ENGINE_LICENSE_FILES = LICENSE
 
 DOCKER_ENGINE_DEPENDENCIES = host-go host-pkgconf
+DOCKER_ENGINE_SRC_SUBDIR = github.com/docker/docker
 
 DOCKER_ENGINE_LDFLAGS = \
 	-X main.GitCommit=$(DOCKER_ENGINE_VERSION) \
 	-X main.Version=$(DOCKER_ENGINE_VERSION)
 
-ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_STATIC_CLIENT),y)
-DOCKER_ENGINE_LDFLAGS += -extldflags '-static'
-endif
-
 DOCKER_ENGINE_TAGS = cgo exclude_graphdriver_zfs autogen
-DOCKER_ENGINE_BUILD_TARGETS = cmd/docker
+DOCKER_ENGINE_BUILD_TARGETS = cmd/dockerd
 
 ifeq ($(BR2_PACKAGE_LIBSECCOMP),y)
 DOCKER_ENGINE_TAGS += seccomp
@@ -32,11 +28,7 @@ endif
 ifeq ($(BR2_INIT_SYSTEMD),y)
 DOCKER_ENGINE_TAGS += journald
 DOCKER_ENGINE_DEPENDENCIES += systemd
-endif
-
-ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DAEMON),y)
-DOCKER_ENGINE_TAGS += daemon
-DOCKER_ENGINE_BUILD_TARGETS += cmd/dockerd
+DOCKER_ENGINE_TAGS += systemd journald
 endif
 
 ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_EXPERIMENTAL),y)
@@ -64,15 +56,16 @@ 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
+DOCKER_ENGINE_INIT_BIN = dumb-init
 else
-DOCKER_ENGINE_INSTALL_BINS += tini
+DOCKER_ENGINE_INIT_BIN = tini
 endif
 
 define DOCKER_ENGINE_RUN_AUTOGEN
 	cd $(@D) && \
 		GITCOMMIT="$$(echo $(DOCKER_ENGINE_COMMIT) | head -c7)" \
 		BUILDTIME="$$(date)" \
+		IAMSTATIC="true" \
 		VERSION="$(patsubst v%,%,$(DOCKER_ENGINE_VERSION))" \
 		PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" $(TARGET_MAKE_ENV) \
 		bash ./hack/make/.go-autogen
@@ -80,7 +73,12 @@ endef
 
 DOCKER_ENGINE_POST_CONFIGURE_HOOKS += DOCKER_ENGINE_RUN_AUTOGEN
 
-ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DAEMON),y)
+define DOCKER_ENGINE_LINK_INIT
+	ln -s $(DOCKER_ENGINE_INIT_BIN) \
+		$(TARGET_DIR)/usr/bin/$(DOCKER_ENGINE_INIT_BIN)
+endef
+
+DOCKER_ENGINE_POST_INSTALL_HOOKS += DOCKER_ENGINE_LINK_INIT
 
 define DOCKER_ENGINE_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 0644 $(@D)/contrib/init/systemd/docker.service \
@@ -96,6 +94,4 @@ define DOCKER_ENGINE_USERS
 	- - docker -1 * - - - Docker Application Container Framework
 endef
 
-endif
-
 $(eval $(golang-package))
Signature · 1 line
2.16.1
#6 lore raw

PATCH v3 1/6 tini: new package

In reply to Christian Stewart

Tini is a minimal init process to act as PID 1 for containers.

Tini can be used to satisfy docker-engine's docker-init binary requirement.

---

Changes since v2:

- Upgraded to v0.17.0
- Added hash for license file

---
 package/Config.in      |  1 +
 package/tini/Config.in | 16 ++++++++++++++++
 package/tini/tini.hash |  3 +++
 package/tini/tini.mk   | 35 +++++++++++++++++++++++++++++++++++
 4 files changed, 55 insertions(+)
 create mode 100644 package/tini/Config.in
 create mode 100644 package/tini/tini.hash
 create mode 100644 package/tini/tini.mk
package/Config.in +1 -0
index 20fe5ad8ff..9d657287cd 100644
@@ -1983,6 +1983,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"
package/tini/Config.in new file +16 -0
new file mode 100644
index 0000000000..235fc1a8fb
@@ -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
package/tini/tini.hash new file +3 -0
new file mode 100644
index 0000000000..c4f85c43b0
@@ -0,0 +1,3 @@
+# Locally computed
+sha256	5244691718f6856db74dcf6dbb3576a901e737f41412e7895747f0ccb4ccaff0	tini-v0.17.0.tar.gz
+sha256	e5f46bca81266bdd511cf08018d66866870531794569c04f9b45f50dd23c28b0	LICENSE
package/tini/tini.mk new file +35 -0
new file mode 100644
index 0000000000..9f9d986745
@@ -0,0 +1,35 @@
+################################################################################
+#
+# tini
+#
+################################################################################
+
+TINI_VERSION = v0.17.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=\"\"
+TINI_CFLAGS += -static
+
+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
+	$(TARGET_CC) \
+		$(TINI_CFLAGS) \
+		-o $(@D)/tini $(@D)/src/tini.c
+endef
+
+define TINI_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/tini $(TARGET_DIR)/usr/bin/tini
+endef
+
+# Tini's CMakeLists.txt is not suitable for Buildroot.
+$(eval $(generic-package))
Signature · 1 line
2.16.1
#7 lore raw

PATCH v3 1/6 tini: new package

Christian,

Quoted 5 lines · Christian Stewart

Tini is a minimal init process to act as PID 1 for containers.

Tini can be used to satisfy docker-engine's docker-init binary requirement.

What's the best way for me to build a test configuration for this series? Is there a buildroot defconfig you tailor for host vs container? Wondering if a test case would be a good way to capture how this is being used? (I'm more then happy to write the case and try it. Been meaning to tinker with docker :-) )

Matt

#8 lore raw

PATCH v3 1/6 tini: new package

In reply to Christian Stewart

Christian, All,

Gah, I previously replied to the unversioned series.... Please consider my reply there, plus a little extra below...

On 2018-07-14 18:07 -0700, Christian Stewart spake thusly:

Quoted 6 lines

Tini is a minimal init process to act as PID 1 for containers.

Tini can be used to satisfy docker-engine's docker-init binary requirement.

[--SNIP--]

package/tini/Config.in line 2

Quoted 8 lines
package/tini/Config.in new file +2 -0
new file mode 100644
index 0000000000..235fc1a8fb
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_TINI
+	bool "tini"

Since you want to do a static build (which I questioned in my previous reply), you should depend on static libs being actually available, i.e.:

depends on !BR2_SHARED_LIBS # Static build

Regards,
Yann E. MORIN.

Quoted 71 lines
package/tini/Config.in new file +14 -0
+	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
package/tini/tini.hash new file +3 -0
new file mode 100644
index 0000000000..c4f85c43b0
@@ -0,0 +1,3 @@
+# Locally computed
+sha256	5244691718f6856db74dcf6dbb3576a901e737f41412e7895747f0ccb4ccaff0	tini-v0.17.0.tar.gz
+sha256	e5f46bca81266bdd511cf08018d66866870531794569c04f9b45f50dd23c28b0	LICENSE
package/tini/tini.mk new file +35 -0
new file mode 100644
index 0000000000..9f9d986745
@@ -0,0 +1,35 @@
+################################################################################
+#
+# tini
+#
+################################################################################
+
+TINI_VERSION = v0.17.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=\"\"
+TINI_CFLAGS += -static
+
+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
+	$(TARGET_CC) \
+		$(TINI_CFLAGS) \
+		-o $(@D)/tini $(@D)/src/tini.c
+endef
+
+define TINI_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/tini $(TARGET_DIR)/usr/bin/tini
+endef
+
+# Tini's CMakeLists.txt is not suitable for Buildroot.
+$(eval $(generic-package))
Signature · 6 lines
2.16.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#9 lore raw

PATCH v3 1/6 tini: new package

Hi Yann,

Quoted 5 lines · Yann E. MORIN

Since you want to do a static build (which I questioned in my previous reply), you should depend on static libs being actually available, i.e.:

depends on !BR2_SHARED_LIBS # Static build

I went over this with Thomas before the last time I tried to merge a similar series.

Here are the relevant bits:

Quoted 4 lines

The next issue is that your package assumes that static linking is possible. But Buildroot defaults to BR2_SHARED_LIBS, which means that the toolchain may not necessarily provide libc.a and allow static linking.

I'm able to compile with BR2_SHARED_LIBS and still produce a static output with -static. Why is this possible? I remember seeing an email about this at some point, where it was stated that glibc.a or so was not produced with BR2_SHARED_LIBS. Why can I then compile this package in this way?

Quoted 3 lines

Alternatively, you could decide to build dumb-init statically only if !BR2_SHARED_LIBS, but that means that in the default Buildroot configurations, dumb-init would be linked dynamically.

This wouldn't work unfortunately in 95% of the intended cases where dumb-init would be used. I'm using a shared build for example.

Then, Thomas asks me to test it out:

Quoted 8 lines

Could you try a completely dynamic build with uClibc and musl ?

Something like this:

BR2_arm=y
BR2_cortex_a8=y
BR2_SHARED_LIBS=y

Quoted 6 lines
Quoted 2 lines

This wouldn't work unfortunately in 95% of the intended cases where dumb-init would be used.

Let's see what the above test does. If it's able to build a static binary even though BR2_SHARED_LIBS=y, then OK, we're good. Otherwise, we'll have to find a different solution.

I completed the test with this defconfig:

BR2_arm=y
BR2_cortex_a8=y
BR2_SHARED_LIBS=y
BR2_PACKAGE_DUMB_INIT=y

The build passed.

To me, the logic goes, if you're doing a static build, you can't build a shared binary. If you're doing a shared build, you can always build a static binary. Is this not the case?

Either way, this part of the series is not important. I'm happy to respin it with just the docker-cli and docker-engine split (caused originally by trying to upgrade docker-engine).

Best,
Christian Stewart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180715/1af0f249/attachment.html>

#10 lore raw

PATCH v3 1/6 tini: new package

Christian, All,

On 2018-07-15 12:26 -0700, Christian Stewart spake thusly:

Quoted 11 lines

Hi Yann,
On Sun, Jul 15, 2018 at 9:01 AM Yann E. MORIN < [1][email protected]> wrote:

Since you want to do a static build (which I questioned in my previous reply), you should depend on static libs being actually available, i.e.:

? ? depends on !BR2_SHARED_LIBS # Static build

I went over this with Thomas before the last time I tried to merge a similar series. Here are the relevant bits:

[--SNIP--]

Then why did you not add those explanation in the commit log, in this new iteration?

Personally, I don't care about a commit log that says "hey, let's add a new package". That is pretty much obvious from the diffstat itself.

What a commit log is here for, is to explain the tricky details of why a specific technical solution is used, especially when it is not obvious that it works, and more especially when it runs contrary to the usual and common knowledge/wisdom.

Then, when we need to look back at the code in the (far!) future, and we wonder "how on Earth can this even work to begin with?", we can git-blame or git-log the file and see the corresponding commit and commit log, and understand that litle detail. Because by then, the post on the mailing list about a comment on the nth-previous iteration will be long forgotten.

Quoted 2 lines

Either way, this part of the series is not important. I'm happy to respin it with just the docker-cli and docker-engine split (caused originally by trying to upgrade docker-engine).

Yes, please do so: untangle the two and bump them, since this is not very controversial.

But still, I'd like to understand why we need to have the host provide an init to the guest, and why can't the guest be responsible for providing its own init... Sorry if you already replied to that in another thread... In which case those explanations would have been great to be repeated in the commit log itself.

Thanks! :-)

Regards,
Yann E. MORIN.

Quoted 5 lines

Best,
Christian Stewart

Links:
1. mailto:yann.morin.1998 at free.fr

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#11 lore raw

PATCH v3 1/6 tini: new package

In reply to Christian Stewart
Quoted 3 lines · Christian Stewart

To me, the logic goes, if you're doing a static build, you can't build a shared binary. If you're doing a shared build, you can always build a static binary. Is this not the case?

The toolchains always install libc.a (and libm.a too, I think). So as long as
you use _only_ libc.a, you can do a static link even in BR2_SHARED_LIBS. But as soon as you use anything else (in particular, in the case of glibc, libnss which gets pulled in automatically if you use some getnameinfo related function), it's no longer possible to link statically.

So yes, it is possible to link some individual packages statically even in
BR2_SHARED_LIBS.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#12 lore raw

PATCH v3 2/6 dumb-init: new package

In reply to Christian Stewart

dumb-init is a minimal init process to act as PID 1 for containers.

Static compilation is used, as dumb-init will typically be executed inside a container.

dumb-init can satisfy docker-engine's docker-init requirement.

---

Changes since v1:

- Upgraded to v1.2.1
- Added license hash

---
 package/Config.in                |  1 +
 package/dumb-init/Config.in      |  7 +++++++
 package/dumb-init/dumb-init.hash |  3 +++
 package/dumb-init/dumb-init.mk   | 24 ++++++++++++++++++++++++
 4 files changed, 35 insertions(+)
 create mode 100644 package/dumb-init/Config.in
 create mode 100644 package/dumb-init/dumb-init.hash
 create mode 100644 package/dumb-init/dumb-init.mk
package/Config.in +1 -0
index 9d657287cd..2aeb8d0f10 100644
@@ -1968,6 +1968,7 @@ comment "Utilities"
 	source "package/crudini/Config.in"
 	source "package/dialog/Config.in"
 	source "package/dtach/Config.in"
+	source "package/dumb-init/Config.in"
 	source "package/easy-rsa/Config.in"
 	source "package/file/Config.in"
 	source "package/gnupg/Config.in"
package/dumb-init/Config.in new file +7 -0
new file mode 100644
index 0000000000..e817493605
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_DUMB_INIT
+	bool "dumb-init"
+	help
+	  dumb-init is a simple but valid init binary to
+	  act as PID 1 for containers.
+
+	  https://github.com/Yelp/dumb-init
package/dumb-init/dumb-init.hash new file +3 -0
new file mode 100644
index 0000000000..9e74ff5580
@@ -0,0 +1,3 @@
+# Locally computed
+sha256	56858088d9d6c911c227d196fcbfca06aff31fbe83e1519f9cabe5cf6f11b242	dumb-init-v1.2.1.tar.gz
+sha256	4d74123f166ad8f147e9939bfb451578db84823f22b48fd64b1086d3654a0149  LICENSE
package/dumb-init/dumb-init.mk new file +24 -0
new file mode 100644
index 0000000000..4ebbff1930
@@ -0,0 +1,24 @@
+################################################################################
+#
+# dumb-init
+#
+################################################################################
+
+DUMB_INIT_VERSION = v1.2.1
+DUMB_INIT_SITE = $(call github,Yelp,dumb-init,$(DUMB_INIT_VERSION))
+
+DUMB_INIT_LICENSE = MIT
+DUMB_INIT_LICENSE_FILES = LICENSE
+DUMB_INIT_CFLAGS += -static
+
+define DUMB_INIT_BUILD_CMDS
+	$(TARGET_CC) \
+		$(DUMB_INIT_CFLAGS) \
+		-o $(@D)/dumb-init $(@D)/dumb-init.c
+endef
+
+define DUMB_INIT_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/dumb-init $(TARGET_DIR)/usr/bin/dumb-init
+endef
+
+$(eval $(generic-package))
Signature · 1 line
2.16.1
#13 lore raw

PATCH v3 3/6 docker-engine: add support for init processes

In reply to Christian Stewart

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"

---
 package/docker-engine/Config.in        | 26 ++++++++++++++++++++++++++
 package/docker-engine/docker-engine.mk |  6 ++++++
 2 files changed, 32 insertions(+)
package/docker-engine/Config.in +26 -0
index 8feb11b48c..a76940b6c0 100644
@@ -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
package/docker-engine/docker-engine.mk +6 -0
index ba84b4cf0a..a85f4b5784 100644
@@ -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)" \
Signature · 1 line
2.16.1
#14 lore raw

PATCH v3 4/6 runc: bump to 69663f0b

In reply to Christian Stewart

This commit bumps runc to the requisite version for Docker 2018.06.

Added note about where runc version dependency is declared:

RUNC_VERSION = 69663f0bd4b60df09991c08812a60108003fa340

---
 package/runc/runc.hash | 2 +-
 package/runc/runc.mk   | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
package/runc/runc.hash +1 -1
index 3e188c5c79..d6bdfe24c7 100644
@@ -1,2 +1,2 @@
 # Locally computed
-sha256	b5c50d7d9a5f610d5424f96196efa306ec708fd9299302dd919545099c16b7c1	runc-9c2d8d184e5da67c95d601382adf14862e4f2228.tar.gz
+sha256	994a3a0447fcbf7e37614b02aa5604d2d6b9fdb41e6870d8d3ff1138ed6e61ef  runc-69663f0bd4b60df09991c08812a60108003fa340.tar.gz
package/runc/runc.mk +2 -1
index f1586f32b2..7f42c962f3 100644
@@ -4,7 +4,8 @@
 #
 ################################################################################
 
-RUNC_VERSION = 9c2d8d184e5da67c95d601382adf14862e4f2228
+# docker-engine/hack/dockerfile/install/runc.installer:4 RUNC_COMMIT=...
+RUNC_VERSION = 69663f0bd4b60df09991c08812a60108003fa340
 RUNC_SITE = $(call github,opencontainers,runc,$(RUNC_VERSION))
 RUNC_LICENSE = Apache-2.0
 RUNC_LICENSE_FILES = LICENSE
Signature · 1 line
2.16.1
#15 lore raw

PATCH v3 5/6 docker-containerd: bump to v1.1.1

In reply to Christian Stewart

This commit bumps docker-containerd to v1.1.1.

This is a requisite bump for the upgrade of docker-engine to 2018.06.

---
 package/docker-containerd/Config.in              | 12 ++++++++++++
 package/docker-containerd/docker-containerd.hash |  2 +-
 package/docker-containerd/docker-containerd.mk   | 18 +++++++++++++++---
 3 files changed, 28 insertions(+), 4 deletions(-)
package/docker-containerd/Config.in +12 -0
index 2f7bf71af1..851345f73e 100644
@@ -15,6 +15,18 @@ config BR2_PACKAGE_DOCKER_CONTAINERD
 
 	  https://github.com/docker/containerd
 
+if BR2_PACKAGE_DOCKER_CONTAINERD
+
+config BR2_PACKAGE_DOCKER_CONTAINERD_DRIVER_BTRFS
+	bool "btrfs snapshot driver"
+	depends on BR2_USE_MMU # btrfs-progs
+	depends on BR2_TOOLCHAIN_HAS_THREADS # btrfs-progs
+	select BR2_PACKAGE_BTRFS_PROGS
+	help
+	  Build the btrfs snapshot driver for containerd.
+
+endif
+
 comment "docker-containerd needs a toolchain w/ threads"
 	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
 	depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
package/docker-containerd/docker-containerd.hash +1 -1
index 992eb5b01a..6d5ed45589 100644
@@ -1,2 +1,2 @@
 # Computed locally
-sha256	da89086a7c643702a2ddecec67a45d3d8e4b0d610dd19036be63e6bd54cc1a85	docker-containerd-9048e5e50717ea4497b757314bad98ea3763c145.tar.gz
+sha256	2901e3f6113ea97850ec9ac5640db0273c7f10e887701f7da2cf3ae1a730934e  docker-containerd-v1.1.1.tar.gz
package/docker-containerd/docker-containerd.mk +15 -3
index 09e89f1aba..85dd6e1f71 100644
@@ -4,8 +4,9 @@
 #
 ################################################################################
 
-DOCKER_CONTAINERD_VERSION = 9048e5e50717ea4497b757314bad98ea3763c145
-DOCKER_CONTAINERD_SITE = $(call github,docker,containerd,$(DOCKER_CONTAINERD_VERSION))
+DOCKER_CONTAINERD_VERSION = v1.1.1
+DOCKER_CONTAINERD_COMMIT = d64c661f1d51c48782c9cec8fda7604785f93587
+DOCKER_CONTAINERD_SITE = $(call github,containerd,containerd,$(DOCKER_CONTAINERD_VERSION))
 DOCKER_CONTAINERD_LICENSE = Apache-2.0
 DOCKER_CONTAINERD_LICENSE_FILES = LICENSE.code
 
@@ -14,10 +15,21 @@ DOCKER_CONTAINERD_WORKSPACE = vendor
 DOCKER_CONTAINERD_LDFLAGS = \
 	-X github.com/docker/containerd.GitCommit=$(DOCKER_CONTAINERD_VERSION)
 
-DOCKER_CONTAINERD_BUILD_TARGETS = ctr containerd containerd-shim
+DOCKER_CONTAINERD_BUILD_TARGETS = cmd/ctr cmd/containerd cmd/containerd-shim
 
 DOCKER_CONTAINERD_INSTALL_BINS = containerd containerd-shim
 
+ifeq ($(BR2_PACKAGE_LIBSECCOMP),y)
+DOCKER_CONTAINERD_DEPENDENCIES += libseccomp
+DOCKER_CONTAINERD_TAGS += seccomp
+endif
+
+ifeq ($(BR2_PACKAGE_DOCKER_CONTAINERD_DRIVER_BTRFS),y)
+DOCKER_CONTAINERD_DEPENDENCIES += btrfs-progs
+else
+DOCKER_CONTAINERD_TAGS += no_btrfs
+endif
+
 define DOCKER_CONTAINERD_INSTALL_SYMLINKS
 	ln -fs runc $(TARGET_DIR)/usr/bin/docker-runc
 	ln -fs containerd-shim $(TARGET_DIR)/usr/bin/docker-containerd-shim
Signature · 1 line
2.16.1
#16 lore raw

PATCH v3 6/6 docker-engine: split into docker-{cli, engine}, bump v2018.06-ce-rc3

In reply to Christian Stewart

Docker upstream has split the Docker daemon and CLI into separate codebases:

- github.com/docker/docker-engine: daemon, remains in docker-engine
- github.com/docker/cli: cli, split into docker-cli and selected by engine

This commit splits the docker-engine package into docker-engine and docker-cli. Conveniently, the Docker project has begun maintaining two separate release-tagged repositories for the CLI and daemon as of v18.06-ce-rc1. Previous versions were tagged in a common "docker-ce" repository which makes compilation awkward for Buildroot, especially due to some limitations in the new Go package infrastructure.

Legacy flags are added to ease the transition:

- BR2_PACKAGE_DOCKER_ENGINE_STATIC_CLIENT=y -> BR2_PACKAGE_DOCKER_CLI_STATIC
- docker-engine selects docker-cli

Docker repositories "engine" and "cli" recently started tagging releases as recent as v18.06-ce-rc1, so we pull the latest tagged release v18.06-ce-rc3 and upgrade to v18.06-ce when it is released.

---
 Config.in.legacy                         |  9 +++++++++
 package/Config.in                        |  1 +
 package/docker-cli/Config.in             | 25 +++++++++++++++++++++++++
 package/docker-cli/docker-cli.hash       |  2 ++
 package/docker-cli/docker-cli.mk         | 29 +++++++++++++++++++++++++++++
 package/docker-engine/Config.in          |  7 +------
 package/docker-engine/docker-engine.hash |  2 +-
 package/docker-engine/docker-engine.mk   | 32 ++++++++++++++------------------
 8 files changed, 82 insertions(+), 25 deletions(-)
 create mode 100644 package/docker-cli/Config.in
 create mode 100644 package/docker-cli/docker-cli.hash
 create mode 100644 package/docker-cli/docker-cli.mk
Config.in.legacy +9 -0
index 9743ebd08f..4cf9d05b9c 100644
@@ -242,6 +242,15 @@ config BR2_GDB_VERSION_7_10
 ###############################################################################
 comment "Legacy options removed in 2018.05"
 
+config BR2_PACKAGE_DOCKER_ENGINE_STATIC_CLIENT
+	bool "docker-engine static client option renamed"
+	select BR2_LEGACY
+  select BR2_PACKAGE_DOCKER_CLI_STATIC
+	help
+	  For consistency reasons, the option
+	  BR2_PACKAGE_DOCKER_ENGINE_STATIC_CLIENT has been renamed to
+	  BR2_PACKAGE_DOCKER_CLI_STATIC
+
 config BR2_PACKAGE_MEDIAART_BACKEND_NONE
 	bool "libmediaart none backend option renamed"
 	select BR2_LEGACY
package/Config.in +1 -0
index 2aeb8d0f10..28c1452a0f 100644
@@ -2007,6 +2007,7 @@ menu "System tools"
 	source "package/dcron/Config.in"
 	source "package/ddrescue/Config.in"
 	source "package/debianutils/Config.in"
+	source "package/docker-cli/Config.in"
 	source "package/docker-compose/Config.in"
 	source "package/docker-containerd/Config.in"
 	source "package/docker-engine/Config.in"
package/docker-cli/Config.in new file +25 -0
new file mode 100644
index 0000000000..82c35c453d
@@ -0,0 +1,25 @@
+config BR2_PACKAGE_DOCKER_CLI
+	bool "docker-cli"
+	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
+	depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	help
+	  Docker is a platform to build, ship,
+	  and run applications as lightweight containers.
+
+	  https://github.com/docker/cli
+
+if BR2_PACKAGE_DOCKER_CLI
+
+config BR2_PACKAGE_DOCKER_CLI_STATIC
+	bool "build static client"
+	depends on !BR2_STATIC_LIBS
+	help
+	  Build a static docker client.
+
+endif
+
+comment "docker-cli needs a toolchain w/ threads"
+	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
+	depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
package/docker-cli/docker-cli.hash new file +2 -0
new file mode 100644
index 0000000000..92b821de36
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256	06a302b43d6a2110ca33808077ca025f4adf9992c32a3cebc5373ecc3cdd44a2  docker-cli-v18.06.0-ce-rc3.tar.gz
package/docker-cli/docker-cli.mk new file +29 -0
new file mode 100644
index 0000000000..f11a8b514e
@@ -0,0 +1,29 @@
+###############################################################################
+#
+# docker-cli
+#
+################################################################################
+
+DOCKER_CLI_VERSION = v18.06.0-ce-rc3
+DOCKER_CLI_SITE = $(call github,docker,cli,$(DOCKER_CLI_VERSION))
+DOCKER_CLI_WORKSPACE = gopath
+
+DOCKER_CLI_LICENSE = Apache-2.0
+DOCKER_CLI_LICENSE_FILES = LICENSE
+
+DOCKER_CLI_DEPENDENCIES = host-go host-pkgconf
+
+DOCKER_CLI_LDFLAGS = \
+	-X github.com/docker/cli/cli.GitCommit=$(DOCKER_CLI_VERSION) \
+	-X github.com/docker/cli/cli.Version=$(DOCKER_CLI_VERSION)
+
+ifeq ($(BR2_PACKAGE_DOCKER_CLI_STATIC),y)
+DOCKER_CLI_LDFLAGS += -extldflags '-static'
+endif
+
+DOCKER_CLI_TAGS = cgo autogen
+DOCKER_CLI_BUILD_TARGETS = cmd/docker
+
+DOCKER_CLI_INSTALL_BINS = $(notdir $(DOCKER_CLI_BUILD_TARGETS))
+
+$(eval $(golang-package))
package/docker-engine/Config.in +1 -6
index a76940b6c0..e1e8ce0065 100644
@@ -3,6 +3,7 @@ config BR2_PACKAGE_DOCKER_ENGINE
 	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
 	depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
 	depends on BR2_TOOLCHAIN_HAS_THREADS
+  select BR2_PACKAGE_DOCKER_CLI
 	help
 	  Docker is a platform to build, ship,
 	  and run applications as lightweight containers.
@@ -26,12 +27,6 @@ config BR2_PACKAGE_DOCKER_ENGINE_DAEMON
 config BR2_PACKAGE_DOCKER_ENGINE_EXPERIMENTAL
 	bool "build experimental features"
 
-config BR2_PACKAGE_DOCKER_ENGINE_STATIC_CLIENT
-	bool "build static client"
-	depends on !BR2_STATIC_LIBS
-	help
-	  Build a static docker client.
-
 if BR2_PACKAGE_DOCKER_ENGINE_DAEMON
 
 choice
package/docker-engine/docker-engine.hash +1 -1
index 6c0ed338a5..592f570a09 100644
@@ -1,2 +1,2 @@
 # Locally calculated
-sha256	4716df117d867b82ddab2e82395cd40aa3d0925a689eedcec8919729e4c9f121	docker-engine-v17.05.0-ce.tar.gz
+sha256	faf546bf0fdcf32d4f9ddbe67759fb39871dc9ea42bddffea23286fcdbf28842  docker-engine-v18.06.0-ce-rc3.tar.gz
package/docker-engine/docker-engine.mk +14 -18
index a85f4b5784..b251befa09 100644
@@ -4,25 +4,21 @@
 #
 ################################################################################
 
-DOCKER_ENGINE_VERSION = v17.05.0-ce
-DOCKER_ENGINE_COMMIT = 89658bed64c2a8fe05a978e5b87dbec409d57a0f
-DOCKER_ENGINE_SITE = $(call github,docker,docker,$(DOCKER_ENGINE_VERSION))
+DOCKER_ENGINE_VERSION = v18.06.0-ce-rc3
+DOCKER_ENGINE_SITE = $(call github,docker,engine,$(DOCKER_ENGINE_VERSION))
 
 DOCKER_ENGINE_LICENSE = Apache-2.0
 DOCKER_ENGINE_LICENSE_FILES = LICENSE
 
 DOCKER_ENGINE_DEPENDENCIES = host-go host-pkgconf
+DOCKER_ENGINE_SRC_SUBDIR = github.com/docker/docker
 
 DOCKER_ENGINE_LDFLAGS = \
 	-X main.GitCommit=$(DOCKER_ENGINE_VERSION) \
 	-X main.Version=$(DOCKER_ENGINE_VERSION)
 
-ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_STATIC_CLIENT),y)
-DOCKER_ENGINE_LDFLAGS += -extldflags '-static'
-endif
-
 DOCKER_ENGINE_TAGS = cgo exclude_graphdriver_zfs autogen
-DOCKER_ENGINE_BUILD_TARGETS = cmd/docker
+DOCKER_ENGINE_BUILD_TARGETS = cmd/dockerd
 
 ifeq ($(BR2_PACKAGE_LIBSECCOMP),y)
 DOCKER_ENGINE_TAGS += seccomp
@@ -32,11 +28,7 @@ endif
 ifeq ($(BR2_INIT_SYSTEMD),y)
 DOCKER_ENGINE_TAGS += journald
 DOCKER_ENGINE_DEPENDENCIES += systemd
-endif
-
-ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DAEMON),y)
-DOCKER_ENGINE_TAGS += daemon
-DOCKER_ENGINE_BUILD_TARGETS += cmd/dockerd
+DOCKER_ENGINE_TAGS += systemd journald
 endif
 
 ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_EXPERIMENTAL),y)
@@ -64,15 +56,16 @@ 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
+DOCKER_ENGINE_INIT_BIN = dumb-init
 else
-DOCKER_ENGINE_INSTALL_BINS += tini
+DOCKER_ENGINE_INIT_BIN = tini
 endif
 
 define DOCKER_ENGINE_RUN_AUTOGEN
 	cd $(@D) && \
 		GITCOMMIT="$$(echo $(DOCKER_ENGINE_COMMIT) | head -c7)" \
 		BUILDTIME="$$(date)" \
+		IAMSTATIC="true" \
 		VERSION="$(patsubst v%,%,$(DOCKER_ENGINE_VERSION))" \
 		PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" $(TARGET_MAKE_ENV) \
 		bash ./hack/make/.go-autogen
@@ -80,7 +73,12 @@ endef
 
 DOCKER_ENGINE_POST_CONFIGURE_HOOKS += DOCKER_ENGINE_RUN_AUTOGEN
 
-ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DAEMON),y)
+define DOCKER_ENGINE_LINK_INIT
+	ln -s $(DOCKER_ENGINE_INIT_BIN) \
+		$(TARGET_DIR)/usr/bin/$(DOCKER_ENGINE_INIT_BIN)
+endef
+
+DOCKER_ENGINE_POST_INSTALL_HOOKS += DOCKER_ENGINE_LINK_INIT
 
 define DOCKER_ENGINE_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 0644 $(@D)/contrib/init/systemd/docker.service \
@@ -96,6 +94,4 @@ define DOCKER_ENGINE_USERS
 	- - docker -1 * - - - Docker Application Container Framework
 endef
 
-endif
-
 $(eval $(golang-package))
Signature · 1 line
2.16.1
#17 lore raw

PATCH 1/6 tini: new package

In reply to Christian Stewart

Christian, All,

On 2018-07-14 18:07 -0700, Christian Stewart spake thusly:

Quoted 6 lines

Tini is a minimal init process to act as PID 1 for containers.

Tini can be used to satisfy docker-engine's docker-init binary requirement.

[--SNIP--]

Quoted 10 lines
package/tini/tini.mk new file +4 -0
new file mode 100644
index 0000000000..9f9d986745
@@ -0,0 +1,35 @@
+################################################################################
+#
+# tini
+#

package/tini/tini.mk line 14

Quoted 10 lines
package/tini/tini.mk new file +10 -0
+################################################################################
+
+TINI_VERSION = v0.17.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=\"\"
+TINI_CFLAGS += -static

I know the rationale behind doing a static build here. However, I ahve a more profound concern. Lemme explain:

If you are going to be runnin "something" inside a docker-based container, surely you will have to provide said "something". Probalby a system on its own, build with Buildroot, or not.

So, why would not that system provide its own init process, how complex might it ever be (ranging from the simplest like tini, to a full-blown systemd for example).

So, why would it be the responsibility of the host system to provide the init program, rather that the responsibility of the guest system?

Note that I did not say we did not want tini. We do want it so that we can build an image that can later server as a guest, bringing its own tini (or dumb-init or whatever).

So, I still question the reason to have tini built as a static binary, provided from the host to the guest...

Regards,
Yann E. MORIN.

Quoted 27 lines
package/tini/tini.mk new file +20 -0
+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
+	$(TARGET_CC) \
+		$(TINI_CFLAGS) \
+		-o $(@D)/tini $(@D)/src/tini.c
+endef
+
+define TINI_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/tini $(TARGET_DIR)/usr/bin/tini
+endef
+
+# Tini's CMakeLists.txt is not suitable for Buildroot.
+$(eval $(generic-package))
Signature · 6 lines
2.16.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#18 lore raw

PATCH 1/6 tini: new package

In reply to Christian Stewart

Christian,

Quoted 7 lines · Christian Stewart

Tini is a minimal init process to act as PID 1 for containers.

Tini can be used to satisfy docker-engine's docker-init binary requirement.

I see this patch is in a "Not Applicable" state. This package is useful as a minimal init in the most basic of LXC containers (cases where docker is overkill). Our use case had the rootfs being shared with the container and this init could remain dyn linked.

I couldn't see a clear path in the thread on next steps. I'm glad to respin with an update.

#19 lore raw

PATCH 1/6 tini: new package

Thomas,

Quoted 10 lines · Matthew Weber
Quoted 1 line · Christian Stewart

Tini is a minimal init process to act as PID 1 for containers.

I see this patch is in a "Not Applicable" state. This package is useful as a minimal init in the most basic of LXC containers (cases where docker is overkill). Our use case had the rootfs being shared with the container and this init could remain dyn linked.

I couldn't see a clear path in the thread on next steps. I'm glad to respin with an update.

Docker is now taking a more direct approach to dealing with process reaping and other concerns Tini was previously used to address. Regardless; the intent of adding Tini is not to satisfy a Docker requirement.

Best,
Christian