Skip to contentSkip to conversation

dumb-init: new package

PATCH New Christian Stewart 5 participants 29 messages Oct 19, 2017 – Oct 24, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/12 dumb-init: new package

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

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

In many cases docker-init backing processes like dumb-init must be static, as they are executed inside a container in an unknown environment. This patch includes an option to specifically compile dumb-init statically, even if the system is compiled dynamically.

---
 package/Config.in                |  1 +
 package/dumb-init/Config.in      | 16 ++++++++++++++++
 package/dumb-init/dumb-init.hash |  2 ++
 package/dumb-init/dumb-init.mk   | 28 ++++++++++++++++++++++++++++
 4 files changed, 47 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 a27f55aec1..c161634daf 100644
@@ -1862,6 +1862,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/file/Config.in"
 	source "package/easy-rsa/Config.in"
 	source "package/gnupg/Config.in"
package/dumb-init/Config.in new file +16 -0
new file mode 100644
index 0000000000..56ca6dc7b1
@@ -0,0 +1,16 @@
+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
+
+if BR2_PACKAGE_DUMB_INIT
+
+config BR2_PACKAGE_DUMB_INIT_STATIC
+	bool "build static"
+	help
+	  Enables static compilation for dumb-init.
+
+endif
package/dumb-init/dumb-init.hash new file +2 -0
new file mode 100644
index 0000000000..e7987b36e2
@@ -0,0 +1,2 @@
+# Locally computed
+sha256	74486997321bd939cad2ee6af030f481d39751bc9aa0ece84ed55f864e309a3f	dumb-init-v1.2.0.tar.gz
package/dumb-init/dumb-init.mk new file +28 -0
new file mode 100644
index 0000000000..f2855122fb
@@ -0,0 +1,28 @@
+################################################################################
+#
+# dumb-init
+#
+################################################################################
+
+DUMB_INIT_VERSION = v1.2.0
+DUMB_INIT_SITE = $(call github,Yelp,dumb-init,$(DUMB_INIT_VERSION))
+
+DUMB_INIT_LICENSE = MIT
+DUMB_INIT_LICENSE_FILES = LICENSE
+DUMB_INIT_CFLAGS=$(TARGET_CFLAGS) $(TARGET_LDFLAGS)
+
+ifeq ($(BR2_PACKAGE_DUMB_INIT_STATIC),y)
+DUMB_INIT_CFLAGS += -static
+endif
+
+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.13.6
#1 lore raw

PATCH 2/12 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.

In many cases docker-init backing processes like Tini must be static, as they are executed inside a container in an unknown environment. This patch adds an option to specifically compile Tini statically, even if the system is compiled dynamically.

---
 package/Config.in      |  1 +
 package/tini/Config.in | 21 +++++++++++++++++++++
 package/tini/tini.hash |  2 ++
 package/tini/tini.mk   | 42 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 66 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 c161634daf..f8f9f39167 100644
@@ -1878,6 +1878,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 +21 -0
new file mode 100644
index 0000000000..323b9d17a1
@@ -0,0 +1,21 @@
+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.
+
+config BR2_PACKAGE_TINI_STATIC
+	bool "build static"
+	help
+	  Enables static compilation for tini.
+
+endif
package/tini/tini.hash new file +2 -0
new file mode 100644
index 0000000000..f8c8c2a3aa
@@ -0,0 +1,2 @@
+# Locally computed
+sha256	c2b7fe2fb92e71911d06b7571b53d4e7e8985b34efe2a599670b070b000c8dbe	tini-v0.16.1.tar.gz
package/tini/tini.mk new file +42 -0

42 lines not on this page · raw message

Signature · 1 line
2.13.6
#2 lore raw

PATCH 2/12 tini: new package

Hello,

package/tini/tini.mk line 25

Quoted 3 lines · Christian Stewart
package/tini/tini.mk new file +3 -0
+ifeq ($(BR2_TOOLCHAIN_HAS_SSP),y)
+TINI_CFLAGS += -fstack-protector --param=ssp-buffer-size=4
+endif

I don't think we want this. Buildroot already passes -fstack-protector globally when BR2_SSP_REGULAR / BR2_SSP_STRONG / BR2_SSP_ALL.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#3 lore raw

PATCH 2/12 tini: new package

Hi Thomas,

Quoted 2 lines · Thomas Petazzoni

I don't think we want this. Buildroot already passes -fstack-protector globally when BR2_SSP_REGULAR / BR2_SSP_STRONG / BR2_SSP_ALL.

Feel free to disable it, I was copying the build flags from the project's Makefile.

Best,
Christian

#4 lore raw

PATCH 3/12 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 | 11 +++++++++++
 2 files changed, 37 insertions(+)
package/docker-engine/Config.in +26 -0
index 05670a716e..7d9a87f7bb 100644
@@ -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
package/docker-engine/docker-engine.mk +11 -0
index 8928f072e7..a2776ed78c 100644
@@ -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), \
+		ln -fs $(DOCKER_ENGINE_INIT) $(TARGET_DIR)/usr/bin/docker-init
+	)
 endef
 
 $(eval $(generic-package))
Signature · 1 line
2.13.6
#5 lore raw

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

Christian, All,

On 2017-10-18 20:22 -0400, Christian Stewart spake thusly:

Quoted 74 lines

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 | 11 +++++++++++
 2 files changed, 37 insertions(+)
package/docker-engine/Config.in +26 -0
index 05670a716e..7d9a87f7bb 100644
@@ -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
package/docker-engine/docker-engine.mk +7 -0
index 8928f072e7..a2776ed78c 100644
@@ -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)

package/docker-engine/docker-engine.mk define DOCKER_ENGINE_INSTALL_TARGET_CMDS · line 130

Quoted 5 lines
package/docker-engine/docker-engine.mk +2 -0
@@ -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.

Quoted 12 lines
package/docker-engine/docker-engine.mk +2 -0
+		ln -fs $(DOCKER_ENGINE_INIT) $(TARGET_DIR)/usr/bin/docker-init
+	)
 endef
 
 $(eval $(generic-package))
Signature · 6 lines
2.13.6

_______________________________________________
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.  |
'------------------------------^-------^------------------^--------------------'
#6 lore raw

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

Hi Yann, Thomas,

Quoted 5 lines · Yann E. MORIN

Why not:

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

That would work too.

Best,
Christian

#7 lore raw

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

In reply to Christian Stewart

Hello,

Quoted 7 lines · 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.

Did you meant "dump-init" here instead of "docker-init" ?

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#8 lore raw

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

Hi Thomas,

Quoted 1 line · Thomas Petazzoni

Did you meant "dump-init" here instead of "docker-init" ?

No, definitely not.

Best,
Christian

#9 lore raw

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

Quoted 7 lines · Christian Stewart

Hi Thomas,

Quoted 1 line · Thomas Petazzoni

Did you meant "dump-init" here instead of "docker-init" ?

No, definitely not.

I think you did. You had written

The docker-init binary is backed by tini on default, but optionally can be changed to docker-init by user preference.

so that would mean that the docker-init binary can be backed by docker-init...

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
#10 lore raw

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

Hi Arnout,

Quoted 9 lines · Arnout Vandecappelle
Quoted 5 lines · Christian Stewart
Quoted 1 line · Thomas Petazzoni

Did you meant "dump-init" here instead of "docker-init" ?

No, definitely not.

I think you did. You had written

Definitely not "dump" init. Yes, I did mean dumb-init and just misspelled it the first time.

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

#11 lore raw

PATCH 4/12 docker-engine: select static for tini and dumb-init

In reply to Christian Stewart

In many cases docker-init backing processes like Tini and dumb-init must be static, as they are executed inside a container in an unknown environment. This patch selects the static compilation options on both packages when used as docker-init backing processes.

---
 package/docker-engine/Config.in | 2 ++
 1 file changed, 2 insertions(+)
package/docker-engine/Config.in +2 -0
index 7d9a87f7bb..47ac7f57a3 100644
@@ -44,6 +44,7 @@ choice
 config BR2_PACKAGE_DOCKER_ENGINE_INIT_TINI
 	bool "tini"
 	select BR2_PACKAGE_TINI
+	select BR2_PACKAGE_TINI_STATIC
 	help
 	  Use Tini as the container init process.
 
@@ -52,6 +53,7 @@ config BR2_PACKAGE_DOCKER_ENGINE_INIT_TINI
 config BR2_PACKAGE_DOCKER_ENGINE_INIT_DUMB_INIT
 	bool "dumb-init"
 	select BR2_PACKAGE_DUMB_INIT
+	select BR2_PACKAGE_DUMB_INIT_STATIC
 	help
 	  Use dumb-init as the container init process.
 
Signature · 1 line
2.13.6
#12 lore raw

PATCH 5/12 docker-proxy: new package

In reply to Christian Stewart

Add docker-proxy package to Buildroot. Needed by docker-engine at runtime, and previously not included. This leads to the following error when attempting to port-map ports to a container:

  $ docker run -p 8080:8080 nginx
  docker: Error response from daemon: driver failed programming external
  connectivity on endpoint:
  exec: "docker-proxy": executable file not found in $PATH.

Docker expects the docker-proxy binary to exist in the PATH.

---
 package/Config.in                      |  1 +
 package/docker-proxy/Config.in         | 18 +++++++++++++
 package/docker-proxy/docker-proxy.hash |  2 ++
 package/docker-proxy/docker-proxy.mk   | 46 ++++++++++++++++++++++++++++++++++
 4 files changed, 67 insertions(+)
 create mode 100644 package/docker-proxy/Config.in
 create mode 100644 package/docker-proxy/docker-proxy.hash
 create mode 100644 package/docker-proxy/docker-proxy.mk
package/Config.in +1 -0
index f8f9f39167..909a8c5d1a 100644
@@ -1903,6 +1903,7 @@ menu "System tools"
 	source "package/debianutils/Config.in"
 	source "package/docker-containerd/Config.in"
 	source "package/docker-engine/Config.in"
+	source "package/docker-proxy/Config.in"
 	source "package/dsp-tools/Config.in"
 	source "package/efibootmgr/Config.in"
 	source "package/efivar/Config.in"
package/docker-proxy/Config.in new file +18 -0
new file mode 100644
index 0000000000..4f414b24b1
@@ -0,0 +1,18 @@
+config BR2_PACKAGE_DOCKER_PROXY
+	bool "docker-proxy"
+	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
+	depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	help
+	  Libnetwork is a Container Network Model that provides a
+	  consistent programming interface and the required network
+	  abstractions for applications.
+
+	  This package provides docker-proxy, a run-time dependency of Docker.
+
+	  https://github.com/docker/libnetwork
+
+comment "docker-proxy 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-proxy/docker-proxy.hash new file +2 -0
new file mode 100644
index 0000000000..3ec184f54f
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256	2eee331b6ded567a36e7db708405b34032b93938682cf049025f48b96d755bf6	docker-proxy-7b2b1feb1de4817d522cc372af149ff48d25028e.tar.gz
package/docker-proxy/docker-proxy.mk new file +46 -0

46 lines not on this page · raw message

Signature · 1 line
2.13.6
#13 lore raw

PATCH 6/12 docker-engine: add dependency on docker-proxy

In reply to Christian Stewart

docker-proxy is needed by docker-engine at runtime, and was previously not included. This leads to the following error when attempting to port-map ports to a container:

  $ docker run -p 8080:8080 nginx
  docker: Error response from daemon: driver failed programming external
  connectivity on endpoint:
  exec: "docker-proxy": executable file not found in $PATH.

Docker expects the docker-proxy binary to exist in the PATH.

---
 package/docker-engine/Config.in | 1 +
 1 file changed, 1 insertion(+)
package/docker-engine/Config.in +1 -0
index 47ac7f57a3..05e7aca7ab 100644
@@ -16,6 +16,7 @@ config BR2_PACKAGE_DOCKER_ENGINE_DAEMON
 	default y
 	depends on BR2_USE_MMU # docker-containerd
 	select BR2_PACKAGE_DOCKER_CONTAINERD # runtime dependency
+	select BR2_PACKAGE_DOCKER_PROXY # runtime dependency
 	select BR2_PACKAGE_IPTABLES # runtime dependency
 	select BR2_PACKAGE_SQLITE # runtime dependency
 	help
Signature · 1 line
2.13.6
#14 lore raw

PATCH 7/12 go: bump version to 1.9

In reply to Christian Stewart

Bumping Go to 1.9 from 1.7.

Go 1.8 comes with significant performance improvements, particularly around ARM: "CPU time required by our benchmark programs was reduced by 20-30% on 32-bit ARM systems."

Go 1.9 is required for docker-engine and other Go packages in Buildroot.

---
 package/go/go.hash | 4 ++--
 package/go/go.mk   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
package/go/go.hash +2 -2
index 1836af2482..445a0b7c20 100644
@@ -1,2 +1,2 @@
-# Locally computed:
-sha256	5f5dea2447e7dcfdc50fa6b94c512e58bfba5673c039259fd843f68829d99fa6	go1.8.3.src.tar.gz
+# From https://golang.org/dl/
+sha256	a4ab229028ed167ba1986825751463605264e44868362ca8e7accc8be057e993	go1.9.src.tar.gz
package/go/go.mk +1 -1
index 0781dff035..93e1189c23 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-GO_VERSION = 1.8.3
+GO_VERSION = 1.9
 GO_SITE = https://storage.googleapis.com/golang
 GO_SOURCE = go$(GO_VERSION).src.tar.gz
 
Signature · 1 line
2.13.6
#15 lore raw

PATCH 7/12 go: bump version to 1.9

Hi Christian,

Quoted 1 line · Christian Stewart

Bumping Go to 1.9 from 1.7.

This patch bumps from 1.8.3. Mention of the old version is not necessary, but it should be correct.

baruch

Quoted 33 lines

Go 1.8 comes with significant performance improvements, particularly around ARM: "CPU time required by our benchmark programs was reduced by 20-30% on 32-bit ARM systems."

Go 1.9 is required for docker-engine and other Go packages in Buildroot.

---
 package/go/go.hash | 4 ++--
 package/go/go.mk   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
package/go/go.hash +2 -2
index 1836af2482..445a0b7c20 100644
@@ -1,2 +1,2 @@
-# Locally computed:
-sha256	5f5dea2447e7dcfdc50fa6b94c512e58bfba5673c039259fd843f68829d99fa6	go1.8.3.src.tar.gz
+# From https://golang.org/dl/
+sha256	a4ab229028ed167ba1986825751463605264e44868362ca8e7accc8be057e993	go1.9.src.tar.gz
package/go/go.mk +1 -1
index 0781dff035..93e1189c23 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-GO_VERSION = 1.8.3
+GO_VERSION = 1.9
 GO_SITE = https://storage.googleapis.com/golang
 GO_SOURCE = go$(GO_VERSION).src.tar.gz
Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
#16 lore raw

PATCH 7/12 go: bump version to 1.9

In reply to Christian Stewart

Hello,

Quoted 9 lines · Christian Stewart

Bumping Go to 1.9 from 1.7.

Go 1.8 comes with significant performance improvements, particularly around ARM: "CPU time required by our benchmark programs was reduced by 20-30% on 32-bit ARM systems."

Go 1.9 is required for docker-engine and other Go packages in Buildroot.

Since you're bumping go, it would be nice if you could review/test:

https://patchwork.ozlabs.org/patch/826431/
https://patchwork.ozlabs.org/patch/826433/
https://patchwork.ozlabs.org/patch/826432/
https://patchwork.ozlabs.org/patch/826434/

And specifically the first one.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#17 lore raw

PATCH 7/12 go: bump version to 1.9

Hi Thomas,

Quoted 3 lines · Thomas Petazzoni

https://patchwork.ozlabs.org/patch/826431/

And specifically the first one.

Tested, works fine. Sending my signed-off in a separate email. I would recommend applying the first patch but not the rest of the series at this point.

Not a dependency for my series to work properly, though.

Best,
Christian

#18 lore raw

PATCH 7/12 go: bump version to 1.9

In reply to Christian Stewart

Hello,

Quoted 6 lines · Christian Stewart

Bumping Go to 1.9 from 1.7.

Go 1.8 comes with significant performance improvements, particularly around ARM: "CPU time required by our benchmark programs was reduced by 20-30% on 32-bit ARM systems."

Quoted 7 lines

Go 1.9 is required for docker-engine and other Go packages in Buildroot.

---
 package/go/go.hash | 4 ++--
 package/go/go.mk   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#19 lore raw

PATCH 8/12 runc: bump to v1.0.0-rc4

In reply to Christian Stewart

This is a dependency of docker-engine v2017.07.0-ce.

---
 package/runc/runc.hash | 2 +-
 package/runc/runc.mk   | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)
package/runc/runc.hash +1 -1
index 3e188c5c79..08e306d0dc 100644
@@ -1,2 +1,2 @@
 # Locally computed
-sha256	b5c50d7d9a5f610d5424f96196efa306ec708fd9299302dd919545099c16b7c1	runc-9c2d8d184e5da67c95d601382adf14862e4f2228.tar.gz
+sha256	3ffefd293932d2ad509701878dd7dd6ef498c3667198a33e8e5d5a3cbce0eeaa	runc-v1.0.0-rc4.tar.gz
package/runc/runc.mk +3 -2
index fb3fec20f5..0b51e11896 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-RUNC_VERSION = 9c2d8d184e5da67c95d601382adf14862e4f2228
+RUNC_VERSION = v1.0.0-rc4
 RUNC_SITE = $(call github,opencontainers,runc,$(RUNC_VERSION))
 RUNC_LICENSE = Apache-2.0
 RUNC_LICENSE_FILES = LICENSE
@@ -38,7 +38,8 @@ define RUNC_CONFIGURE_CMDS
 endef
 
 define RUNC_BUILD_CMDS
-	cd $(@D) && $(RUNC_MAKE_ENV) $(HOST_DIR)/bin/go \
+	cd $(RUNC_GOPATH)/src/github.com/opencontainers/runc && \
+		$(RUNC_MAKE_ENV) $(HOST_DIR)/bin/go \
 		build -v -o $(@D)/bin/runc \
 		-tags "$(RUNC_GOTAGS)" -ldflags "$(RUNC_GLDFLAGS)" .
 endef
Signature · 1 line
2.13.6
#20 lore raw

PATCH 8/12 runc: bump to v1.0.0-rc4

Hello,

Quoted 7 lines · Christian Stewart

This is a dependency of docker-engine v2017.07.0-ce.

---
 package/runc/runc.hash | 2 +-
 package/runc/runc.mk   | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#21 lore raw

PATCH 9/12 docker-containerd: bump to 3addd84

In reply to Christian Stewart

This commit bumps docker-containerd to:

3addd840653146c90a254301d6c3a663c7fd6429

This is a dependency of docker-engine v2017.07.0-ce.

---
 package/docker-containerd/docker-containerd.hash |  2 +-
 package/docker-containerd/docker-containerd.mk   | 13 +++++++------
 2 files changed, 8 insertions(+), 7 deletions(-)
package/docker-containerd/docker-containerd.hash +1 -1
index 992eb5b01a..cdc3a0b4fb 100644
@@ -1,2 +1,2 @@
 # Computed locally
-sha256	da89086a7c643702a2ddecec67a45d3d8e4b0d610dd19036be63e6bd54cc1a85	docker-containerd-9048e5e50717ea4497b757314bad98ea3763c145.tar.gz
+sha256	3549e9c4ff1f71c6c9c5932b36b209f9b7ecae3662d251a88ce349853f0249fc	docker-containerd-3addd840653146c90a254301d6c3a663c7fd6429.tar.gz
package/docker-containerd/docker-containerd.mk +7 -6
index ffbadb0c3f..fe30f19817 100644
@@ -4,8 +4,8 @@
 #
 ################################################################################
 
-DOCKER_CONTAINERD_VERSION = 9048e5e50717ea4497b757314bad98ea3763c145
-DOCKER_CONTAINERD_SITE = $(call github,docker,containerd,$(DOCKER_CONTAINERD_VERSION))
+DOCKER_CONTAINERD_VERSION = 3addd840653146c90a254301d6c3a663c7fd6429
+DOCKER_CONTAINERD_SITE = $(call github,containerd,containerd,$(DOCKER_CONTAINERD_VERSION))
 DOCKER_CONTAINERD_LICENSE = Apache-2.0
 DOCKER_CONTAINERD_LICENSE_FILES = LICENSE.code
 
@@ -18,22 +18,23 @@ DOCKER_CONTAINERD_MAKE_ENV = $(HOST_GO_TARGET_ENV) \
 	GOPATH="$(DOCKER_CONTAINERD_GOPATH)"
 
 DOCKER_CONTAINERD_GLDFLAGS = \
-	-X github.com/docker/containerd.GitCommit=$(DOCKER_CONTAINERD_VERSION)
+	-X github.com/containerd/containerd.GitCommit=$(DOCKER_CONTAINERD_VERSION)
 
 ifeq ($(BR2_STATIC_LIBS),y)
 DOCKER_CONTAINERD_GLDFLAGS += -extldflags '-static'
 endif
 
 define DOCKER_CONTAINERD_CONFIGURE_CMDS
-	mkdir -p $(DOCKER_CONTAINERD_GOPATH)/src/github.com/docker
-	ln -s $(@D) $(DOCKER_CONTAINERD_GOPATH)/src/github.com/docker/containerd
+	mkdir -p $(DOCKER_CONTAINERD_GOPATH)/src/github.com/containerd
+	ln -s $(@D) $(DOCKER_CONTAINERD_GOPATH)/src/github.com/containerd/containerd
 	mkdir -p $(DOCKER_CONTAINERD_GOPATH)/src/github.com/opencontainers
 	ln -s $(RUNC_SRCDIR) $(DOCKER_CONTAINERD_GOPATH)/src/github.com/opencontainers/runc
 endef
 
 define DOCKER_CONTAINERD_BUILD_CMDS
 	$(foreach d,ctr containerd containerd-shim,\
-		cd $(@D); $(DOCKER_CONTAINERD_MAKE_ENV) $(HOST_DIR)/bin/go build \
+		cd $(DOCKER_CONTAINERD_GOPATH)/src/github.com/containerd/containerd; \
+			$(DOCKER_CONTAINERD_MAKE_ENV) $(HOST_DIR)/usr/go build \
 			-v -o $(@D)/bin/$(d) -ldflags "$(DOCKER_CONTAINERD_GLDFLAGS)" ./$(d)$(sep))
 endef
 
Signature · 1 line
2.13.6
#22 lore raw

PATCH 10/12 docker-proxy: bump to 9647f99

In reply to Christian Stewart

This commit bumps docker-proxy to:

9647f993a81e404639592e8ed73693b48ec09c2e

This is a dependency of docker v2017.07:

docker/docker-ce#c867dee see components/engine/vendor.conf.

---
 package/docker-proxy/docker-proxy.hash | 2 +-
 package/docker-proxy/docker-proxy.mk   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
package/docker-proxy/docker-proxy.hash +1 -1
index 3ec184f54f..4e6ba72133 100644
@@ -1,2 +1,2 @@
 # Locally calculated
-sha256	2eee331b6ded567a36e7db708405b34032b93938682cf049025f48b96d755bf6	docker-proxy-7b2b1feb1de4817d522cc372af149ff48d25028e.tar.gz
+sha256	dc0aa06e490fcdb799414f339570f85b474500aecb82aeeb3b7c8215d558dbff	docker-proxy-9647f993a81e404639592e8ed73693b48ec09c2e.tar.gz
package/docker-proxy/docker-proxy.mk +1 -1
index 3bf6546d26..330ecd527f 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-DOCKER_PROXY_VERSION = 7b2b1feb1de4817d522cc372af149ff48d25028e
+DOCKER_PROXY_VERSION = 9647f993a81e404639592e8ed73693b48ec09c2e
 DOCKER_PROXY_SITE = $(call github,docker,libnetwork,$(DOCKER_PROXY_VERSION))
 
 DOCKER_PROXY_LICENSE = Apache-2.0
Signature · 1 line
2.13.6
#23 lore raw

PATCH 11/12 docker-engine: bump to v17.07.0-ce

In reply to Christian Stewart

This commit bumps docker-engine to v17.07.0-ce.

The docker-engine repository has now been moved to:

https://github.com/docker/docker-ce

The CLI and the daemon have been split into separate repositories:

- https://github.com/docker/cli
- https://github.com/moby/moby

The daemon is still in the "moby" repo, but the import paths in Go are:

github.com/docker/docker

As before. Presumably, the maintainers will eventually split the engine out to a different repository as well.

Please note that they literally copy the entire docker/cli and moby/moby repositories into the docker-ce repository, as well as all of their dependencies in the vendor directories. This means that downloading the docker-ce source tarball contains:

- The cli sources
- The daemon sources
- Two copies of all of the dependencies of both

At the moment this is unavoidable, but does produce a working build.

The patch was removed, as it is included in this release.

---
 package/docker-engine/docker-engine.hash |  2 +-
 package/docker-engine/docker-engine.mk   | 54 ++++++++++++++++++--------------
 2 files changed, 31 insertions(+), 25 deletions(-)
package/docker-engine/docker-engine.hash +1 -1
index 6c0ed338a5..0d017dc998 100644
@@ -1,2 +1,2 @@
 # Locally calculated
-sha256	4716df117d867b82ddab2e82395cd40aa3d0925a689eedcec8919729e4c9f121	docker-engine-v17.05.0-ce.tar.gz
+sha256	e3193118306e0d4dc4b9ad329870633d3a78d80c5f00ca6185e14185e717ca7e	docker-engine-v17.07.0-ce.tar.gz
package/docker-engine/docker-engine.mk +30 -24

113 lines not on this page · raw message

Signature · 1 line
2.13.6
#24 lore raw

PATCH 12/12 docker-engine: don't link against libsystemd without systemd

In reply to Christian Stewart

Docker links against libsystemd unconditionally in the latest release. This is entirely unnecessary, and the included patch disables this behavior in the absence of the systemd build tag, which is now set when systemd is enabled in buildroot.

This fixes linking errors when building against sysv, and avoids adding a hard dependency on systemd in Docker.

Docker-Engine should also use the target pkgconfig, not the host pkgconfig. This is fixed in this patch.

---
 ...king-against-libsystemd-with-absence-of-s.patch | 54 ++++++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 package/docker-engine/0001-disable-linking-against-libsystemd-with-absence-of-s.patch
package/docker-engine/0001-disable-linking-against-libsystemd-with-absence-of-s.patch new file +54 -0
new file mode 100644
index 0000000000..9a8b126d5f
@@ -0,0 +1,54 @@
+From 56ab23f03df71d6cd084a9f4fd9c382e47b0e26e Mon Sep 17 00:00:00 2001
+From: Christian Stewart <[email protected]>
+Date: Wed, 20 Sep 2017 18:09:26 +0100
+Subject: [PATCH] disable linking against libsystemd with absence of systemd
+ build tag
+
+For some reason, as of this release, Docker now MUST link against libsystemd.
+
+This is not for a good reason. It's because of two lines in the daemon startup,
+which notify the systemd daemon that the daemon is done starting.
+
+Requiring the presence of an entire systemd library to build Docker is not
+suitable for Buildroot. This patch adds a build tag called "systemd," which
+when not set, will disable linking against libsystemd.
+
+Signed-off-by: Christian Stewart <[email protected]>
+---
+ components/engine/cmd/dockerd/daemon_linux.go           |  2 +-
+ components/engine/cmd/dockerd/daemon_linux_nosystemd.go | 13 +++++++++++++
+ 2 files changed, 14 insertions(+), 1 deletion(-)
+ create mode 100644 components/engine/cmd/dockerd/daemon_linux_nosystemd.go
+
+diff --git a/components/engine/cmd/dockerd/daemon_linux.go b/components/engine/cmd/dockerd/daemon_linux.go
+index a909ee4fbd..89c16bac2f 100644
+--- a/components/engine/cmd/dockerd/daemon_linux.go
++++ b/components/engine/cmd/dockerd/daemon_linux.go
+@@ -1,4 +1,4 @@
+-// +build linux
++// +build linux,systemd
+ 
+ package main
+ 
+diff --git a/components/engine/cmd/dockerd/daemon_linux_nosystemd.go b/components/engine/cmd/dockerd/daemon_linux_nosystemd.go
+new file mode 100644
+index 0000000000..4f7e92af0f
+--- /dev/null
++++ b/components/engine/cmd/dockerd/daemon_linux_nosystemd.go
+@@ -0,0 +1,13 @@
++// +build linux,!systemd
++
++package main
++
++// preNotifySystem sends a message to the host when the API is active, but before the daemon is
++func preNotifySystem() {
++	// noop without systemd
++}
++
++// notifySystem sends a message to the host when the server is ready to be used
++func notifySystem() {
++	// noop without systemd
++}
+-- 
+2.13.5
+
Signature · 1 line
2.13.6
#25 lore raw

PATCH 1/12 dumb-init: new package

In reply to Christian Stewart

Hi Christian,

This is already v3 of the series. Could you explain the changes w.r.t. to the
previous versions? You should do that in the commit message...

Quoted 11 lines · Christian Stewart

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

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

In many cases docker-init backing processes like dumb-init must be static, as they are executed inside a container in an unknown environment. This patch includes an option to specifically compile dumb-init statically, even if the system is compiled dynamically.

... here, separated with a --- line:

---
v3:
- Use foo instead of bar
- Update commit message to explain baz better [Thomas]

The [Thomas] means that this change was based on review feedback from Thomas.

For entirely new patches, you just write:

v3: New patch

Also, you should send the series with "v3" in the subject. With modern git, you
can do that with the -v3 parameter to git send-email or git format-patch.

Of course, no need to resend the series for this, but please do explain in a
mail what the changes are. Makes reviewing a lot simpler.

Regards,
Arnout

[snip]

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
#26 lore raw

PATCH 1/12 dumb-init: new package

Hi Arnout,

Quoted 2 lines · Arnout Vandecappelle

This is already v3 of the series. Could you explain the changes w.r.t. to the
previous versions? You should do that in the commit message...

Yes, typically I would follow the usual workflow but as this patch series has for some reason taken many months to merge I neglected it this time. This series is more of a, "oh hey, that's still pending, I should go submit it" rather than another distinct revision. I'll be sure to follow the guidelines in the future.

The changes here incorporated the minor requested changes from the last series:

- standardize to the github notation for SITE
- update to the latest version of tini

Overall very minor which is why I waited a bit to re-spin, there don't seem to be many requested changes to this series and I've tested it for a few months now.

Best,
Christian

#27 lore raw

PATCH 1/12 dumb-init: new package

In reply to Christian Stewart

Hi Christian,

We were about to apply but then we thought:

package/dumb-init/Config.in line 14

Quoted 4 lines · Christian Stewart
package/dumb-init/Config.in new file +4 -0
+config BR2_PACKAGE_DUMB_INIT_STATIC
+	bool "build static"
+	help
+	  Enables static compilation for dumb-init.

Is it really useful to have this as an option? In practice you'll always want
to link statically, no?

If you're OK with this I can remove the option while applying, no need to
respin just for this.

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
#28 lore raw

PATCH 1/12 dumb-init: new package

Hi Arnout,

Quoted 2 lines · Arnout Vandecappelle

If you're OK with this I can remove the option while applying, no need to
respin just for this.

Go for it, same goes for tini.

Best,
Christian