Add docker v17.12.1

This commit is contained in:
Pascal Vizeli 2018-03-09 22:35:57 +01:00
parent 64a0530134
commit df15d608e1
6 changed files with 621 additions and 0 deletions

View File

@ -0,0 +1,180 @@
From 3305bc41073e79203c2355a1770d44e28b83a948 Mon Sep 17 00:00:00 2001
From: Christian Stewart <christian@paral.in>
Date: Wed, 20 Sep 2017 01:48:40 +0100
Subject: [PATCH] docker-engine: bump to v17.12.1-ce
This commit bumps docker-engine to v17.12.1-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 codebase lives 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 the entire docker/cli and moby/moby repositories are copied
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.
Signed-off-by: Christian Stewart <christian@paral.in>
---
Changes since initial series:
- Upgrade to 2017.12-ce due to critical bugs in 2018.02.
Recommended merge to next branch.
---
package/docker-engine/docker-engine.hash | 2 +-
package/docker-engine/docker-engine.mk | 48 +++++++++++++++++++-------------
2 files changed, 29 insertions(+), 21 deletions(-)
diff --git a/package/docker-engine/docker-engine.hash b/package/docker-engine/docker-engine.hash
index 6c0ed33..add0b89 100644
--- a/package/docker-engine/docker-engine.hash
+++ b/package/docker-engine/docker-engine.hash
@@ -1,2 +1,2 @@
# Locally calculated
-sha256 4716df117d867b82ddab2e82395cd40aa3d0925a689eedcec8919729e4c9f121 docker-engine-v17.05.0-ce.tar.gz
+sha256 e4b58c26c05a800d96d3e5d76375654751d4d1367b5727c798369cf3c78a590e docker-engine-v17.12.1-ce.tar.gz
diff --git a/package/docker-engine/docker-engine.mk b/package/docker-engine/docker-engine.mk
index a2776ed..f9cb4b8 100644
--- a/package/docker-engine/docker-engine.mk
+++ b/package/docker-engine/docker-engine.mk
@@ -4,9 +4,8 @@
#
################################################################################
-DOCKER_ENGINE_VERSION = v17.05.0-ce
-DOCKER_ENGINE_COMMIT = 89658bed64c2a8fe05a978e5b87dbec409d57a0f
-DOCKER_ENGINE_SITE = $(call github,docker,docker,$(DOCKER_ENGINE_VERSION))
+DOCKER_ENGINE_VERSION = v17.12.1-ce
+DOCKER_ENGINE_SITE = $(call github,docker,docker-ce,$(DOCKER_ENGINE_VERSION))
DOCKER_ENGINE_LICENSE = Apache-2.0
DOCKER_ENGINE_LICENSE_FILES = LICENSE
@@ -19,37 +18,43 @@ DOCKER_ENGINE_MAKE_ENV = $(HOST_GO_TARGET_ENV) \
CGO_NO_EMULATION=1 \
GOBIN="$(@D)/bin" \
GOPATH="$(DOCKER_ENGINE_GOPATH)" \
- PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
+ PKG_CONFIG="$(PKG_CONFIG)" \
$(TARGET_MAKE_ENV)
DOCKER_ENGINE_GLDFLAGS = \
-X main.GitCommit=$(DOCKER_ENGINE_VERSION) \
- -X main.Version=$(DOCKER_ENGINE_VERSION)
+ -X main.Version=$(DOCKER_ENGINE_VERSION) \
+ -X github.com/docker/cli/cli.GitCommit=$(DOCKER_ENGINE_VERSION) \
+ -X github.com/docker/cli/cli.Version=$(DOCKER_ENGINE_VERSION)
+
+DOCKER_ENGINE_BUILD_TAGS = cgo exclude_graphdriver_zfs autogen
+DOCKER_ENGINE_BUILD_TARGETS = cli:docker
+DOCKER_ENGINE_BUILD_TARGET_PARSE = \
+ export targetpkg=$$(echo $(target) | cut -d: -f1); \
+ export targetbin=$$(echo $(target) | cut -d: -f2)
ifeq ($(BR2_STATIC_LIBS),y)
DOCKER_ENGINE_GLDFLAGS += -extldflags '-static'
+DOCKER_ENGINE_BUILD_TAGS += static_build
else
ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_STATIC_CLIENT),y)
DOCKER_ENGINE_GLDFLAGS_DOCKER += -extldflags '-static'
endif
endif
-DOCKER_ENGINE_BUILD_TAGS = cgo exclude_graphdriver_zfs autogen
-DOCKER_ENGINE_BUILD_TARGETS = docker
-
ifeq ($(BR2_PACKAGE_LIBSECCOMP),y)
DOCKER_ENGINE_BUILD_TAGS += seccomp
DOCKER_ENGINE_DEPENDENCIES += libseccomp
endif
ifeq ($(BR2_INIT_SYSTEMD),y)
-DOCKER_ENGINE_BUILD_TAGS += journald
DOCKER_ENGINE_DEPENDENCIES += systemd
+DOCKER_ENGINE_BUILD_TAGS += systemd journald
endif
ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DAEMON),y)
DOCKER_ENGINE_BUILD_TAGS += daemon
-DOCKER_ENGINE_BUILD_TARGETS += dockerd
+DOCKER_ENGINE_BUILD_TARGETS += docker:dockerd
ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_INIT_DUMB_INIT),y)
DOCKER_ENGINE_INIT = dumb-init
@@ -83,10 +88,11 @@ endif
define DOCKER_ENGINE_CONFIGURE_CMDS
mkdir -p $(DOCKER_ENGINE_GOPATH)/src/github.com/docker
- ln -fs $(@D) $(DOCKER_ENGINE_GOPATH)/src/github.com/docker/docker
- cd $(@D) && \
- GITCOMMIT="$$(echo $(DOCKER_ENGINE_COMMIT) | head -c7)" \
+ ln -fs $(@D)/components/engine $(DOCKER_ENGINE_GOPATH)/src/github.com/docker/docker
+ ln -fs $(@D)/components/cli $(DOCKER_ENGINE_GOPATH)/src/github.com/docker/cli
+ cd $(@D)/components/engine && \
BUILDTIME="$$(date)" \
+ IAMSTATIC="true" \
VERSION="$(patsubst v%,%,$(DOCKER_ENGINE_VERSION))" \
PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" $(TARGET_MAKE_ENV) \
bash ./hack/make/.go-autogen
@@ -95,9 +101,9 @@ endef
ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DAEMON),y)
define DOCKER_ENGINE_INSTALL_INIT_SYSTEMD
- $(INSTALL) -D -m 0644 $(@D)/contrib/init/systemd/docker.service \
+ $(INSTALL) -D -m 0644 $(@D)/components/engine/contrib/init/systemd/docker.service \
$(TARGET_DIR)/usr/lib/systemd/system/docker.service
- $(INSTALL) -D -m 0644 $(@D)/contrib/init/systemd/docker.socket \
+ $(INSTALL) -D -m 0644 $(@D)/components/engine/contrib/init/systemd/docker.socket \
$(TARGET_DIR)/usr/lib/systemd/system/docker.socket
mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/
ln -fs ../../../../usr/lib/systemd/system/docker.service \
@@ -112,19 +118,21 @@ endif
define DOCKER_ENGINE_BUILD_CMDS
$(foreach target,$(DOCKER_ENGINE_BUILD_TARGETS), \
- cd $(@D)/gopath/src/github.com/docker/docker; \
+ $(DOCKER_ENGINE_BUILD_TARGET_PARSE); \
+ cd $(@D)/gopath/src/github.com/docker/$${targetpkg}; \
$(DOCKER_ENGINE_MAKE_ENV) \
$(HOST_DIR)/bin/go build -v \
- -o $(@D)/bin/$(target) \
+ -o $(@D)/bin/$${targetbin} \
-tags "$(DOCKER_ENGINE_BUILD_TAGS)" \
- -ldflags "$(DOCKER_ENGINE_GLDFLAGS) $(DOCKER_ENGINE_GLDFLAGS_$(call UPPERCASE,$(target)))" \
- github.com/docker/docker/cmd/$(target)
+ -ldflags "$(DOCKER_ENGINE_GLDFLAGS)" \
+ ./cmd/$${targetbin}
)
endef
define DOCKER_ENGINE_INSTALL_TARGET_CMDS
$(foreach target,$(DOCKER_ENGINE_BUILD_TARGETS), \
- $(INSTALL) -D -m 0755 $(@D)/bin/$(target) $(TARGET_DIR)/usr/bin/$(target)
+ $(DOCKER_ENGINE_BUILD_TARGET_PARSE); \
+ $(INSTALL) -D -m 0755 $(@D)/bin/$${targetbin} $(TARGET_DIR)/usr/bin/$${targetbin}
)
$(if $(filter $(BR2_PACKAGE_DOCKER_ENGINE_DAEMON),y), \
--
2.9.0.windows.1

View File

@ -0,0 +1,37 @@
From 5d912b53f76ac2c994ab2376f8a366944b4b2f87 Mon Sep 17 00:00:00 2001
From: Christian Stewart <christian@paral.in>
Date: Mon, 19 Feb 2018 02:24:01 -0500
Subject: [PATCH] go: bump to 1.10
This commit bumps the Go programming language to the 1.10 release.
Signed-off-by: Christian Stewart <christian@paral.in>
---
package/go/go.hash | 2 +-
package/go/go.mk | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/package/go/go.hash b/package/go/go.hash
index 445a0b7..73c1578 100644
--- a/package/go/go.hash
+++ b/package/go/go.hash
@@ -1,2 +1,2 @@
# From https://golang.org/dl/
-sha256 a4ab229028ed167ba1986825751463605264e44868362ca8e7accc8be057e993 go1.9.src.tar.gz
+sha256 f3de49289405fda5fd1483a8fe6bd2fa5469e005fd567df64485c4fa000c7f24 go1.10.src.tar.gz
diff --git a/package/go/go.mk b/package/go/go.mk
index 23facbd..4d55e16 100644
--- a/package/go/go.mk
+++ b/package/go/go.mk
@@ -4,7 +4,7 @@
#
################################################################################
-GO_VERSION = 1.9
+GO_VERSION = 1.10
GO_SITE = https://storage.googleapis.com/golang
GO_SOURCE = go$(GO_VERSION).src.tar.gz
--
2.9.0.windows.1

View File

@ -0,0 +1,115 @@
From f1c537f80a9c829785aaaefdfb2f04f46db565fd Mon Sep 17 00:00:00 2001
From: Christian Stewart <christian@paral.in>
Date: Tue, 9 May 2017 17:22:43 -0400
Subject: [PATCH] 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.
Signed-off-by: Christian Stewart <christian@paral.in>
---
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
diff --git a/package/Config.in b/package/Config.in
index a114c90..28e0caf 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1923,6 +1923,7 @@ comment "Utilities"
source "package/sudo/Config.in"
source "package/terminology/Config.in"
source "package/time/Config.in"
+ source "package/tini/Config.in"
source "package/tmux/Config.in"
source "package/which/Config.in"
source "package/xmlstarlet/Config.in"
diff --git a/package/tini/Config.in b/package/tini/Config.in
new file mode 100644
index 0000000..235fc1a
--- /dev/null
+++ b/package/tini/Config.in
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_TINI
+ bool "tini"
+ help
+ tini is a simple but valid init binary to
+ act as PID 1 for containers.
+
+ https://github.com/krallin/tini
+
+if BR2_PACKAGE_TINI
+
+config BR2_PACKAGE_TINI_MINIMAL
+ bool "build minimal variant"
+ help
+ Disables argument parsing and verbose output.
+
+endif
diff --git a/package/tini/tini.hash b/package/tini/tini.hash
new file mode 100644
index 0000000..c4f85c4
--- /dev/null
+++ b/package/tini/tini.hash
@@ -0,0 +1,3 @@
+# Locally computed
+sha256 5244691718f6856db74dcf6dbb3576a901e737f41412e7895747f0ccb4ccaff0 tini-v0.17.0.tar.gz
+sha256 e5f46bca81266bdd511cf08018d66866870531794569c04f9b45f50dd23c28b0 LICENSE
diff --git a/package/tini/tini.mk b/package/tini/tini.mk
new file mode 100644
index 0000000..9f9d986
--- /dev/null
+++ b/package/tini/tini.mk
@@ -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))
--
2.9.0.windows.1

View File

@ -0,0 +1,123 @@
From 32bad70efcef45070b301cf0797e3b8491439396 Mon Sep 17 00:00:00 2001
From: Christian Stewart <christian@paral.in>
Date: Wed, 20 Sep 2017 03:10:56 +0100
Subject: [PATCH] docker-containerd: bump to v1.0.2
This commit bumps docker-containerd to v1.0.2.
This is a requisite bump for the upgrade of docker-engine to v17.12.1-ce-rc1.
This patch also enables seccomp in containerd if the target system uses it.
Signed-off-by: Christian Stewart <christian@paral.in>
---
package/docker-containerd/Config.in | 12 ++++++++
package/docker-containerd/docker-containerd.hash | 2 +-
package/docker-containerd/docker-containerd.mk | 38 ++++++++++++++++++------
3 files changed, 42 insertions(+), 10 deletions(-)
diff --git a/package/docker-containerd/Config.in b/package/docker-containerd/Config.in
index 2f7bf71..851345f 100644
--- a/package/docker-containerd/Config.in
+++ b/package/docker-containerd/Config.in
@@ -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
diff --git a/package/docker-containerd/docker-containerd.hash b/package/docker-containerd/docker-containerd.hash
index 992eb5b..bc67fe5 100644
--- a/package/docker-containerd/docker-containerd.hash
+++ b/package/docker-containerd/docker-containerd.hash
@@ -1,2 +1,2 @@
# Computed locally
-sha256 da89086a7c643702a2ddecec67a45d3d8e4b0d610dd19036be63e6bd54cc1a85 docker-containerd-9048e5e50717ea4497b757314bad98ea3763c145.tar.gz
+sha256 a31a12846a7a2f697f8fdd82cedd1626fc5f6345e59ae880664196c73e4c2226 docker-containerd-v1.0.2.tar.gz
diff --git a/package/docker-containerd/docker-containerd.mk b/package/docker-containerd/docker-containerd.mk
index ffbadb0..230307d 100644
--- a/package/docker-containerd/docker-containerd.mk
+++ b/package/docker-containerd/docker-containerd.mk
@@ -4,37 +4,57 @@
#
################################################################################
-DOCKER_CONTAINERD_VERSION = 9048e5e50717ea4497b757314bad98ea3763c145
-DOCKER_CONTAINERD_SITE = $(call github,docker,containerd,$(DOCKER_CONTAINERD_VERSION))
+DOCKER_CONTAINERD_VERSION = v1.0.2
+DOCKER_CONTAINERD_COMMIT = cfd04396dc68220d1cecbe686a6cc3aa5ce3667c
+DOCKER_CONTAINERD_SITE = $(call github,containerd,containerd,$(DOCKER_CONTAINERD_VERSION))
DOCKER_CONTAINERD_LICENSE = Apache-2.0
DOCKER_CONTAINERD_LICENSE_FILES = LICENSE.code
DOCKER_CONTAINERD_DEPENDENCIES = host-go
-DOCKER_CONTAINERD_GOPATH = "$(@D)/vendor"
+DOCKER_CONTAINERD_GOPATH = "$(@D)/gopath"
DOCKER_CONTAINERD_MAKE_ENV = $(HOST_GO_TARGET_ENV) \
CGO_ENABLED=1 \
GOBIN="$(@D)/bin" \
GOPATH="$(DOCKER_CONTAINERD_GOPATH)"
DOCKER_CONTAINERD_GLDFLAGS = \
- -X github.com/docker/containerd.GitCommit=$(DOCKER_CONTAINERD_VERSION)
+ -X github.com/containerd/containerd.GitCommit=$(DOCKER_CONTAINERD_COMMIT)
+
+ifeq ($(BR2_PACKAGE_LIBSECCOMP),y)
+DOCKER_CONTAINERD_BUILD_TAGS += seccomp
+DOCKER_CONTAINERD_DEPENDENCIES += libseccomp
+endif
+
+ifeq ($(BR2_PACKAGE_DOCKER_CONTAINERD_DRIVER_BTRFS),y)
+DOCKER_CONTAINERD_DEPENDENCIES += btrfs-progs
+else
+DOCKER_CONTAINERD_BUILD_TAGS += no_btrfs
+endif
ifeq ($(BR2_STATIC_LIBS),y)
-DOCKER_CONTAINERD_GLDFLAGS += -extldflags '-static'
+DOCKER_CONTAINERD_GLDFLAGS += -extldflags '-static -fno-PIC'
+DOCKER_CONTAINERD_BUILD_TAGS += static_build
+DOCKER_CONTAINERD_BUILD_FLAGS += -buildmode pie
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 \
- -v -o $(@D)/bin/$(d) -ldflags "$(DOCKER_CONTAINERD_GLDFLAGS)" ./$(d)$(sep))
+ cd $(DOCKER_CONTAINERD_GOPATH)/src/github.com/containerd/containerd; \
+ $(DOCKER_CONTAINERD_MAKE_ENV) $(HOST_DIR)/bin/go build \
+ -v -i -o $(@D)/bin/$(d) \
+ -tags "$(DOCKER_CONTAINERD_BUILD_TAGS)" \
+ -ldflags "$(DOCKER_CONTAINERD_GLDFLAGS)" \
+ $(DOCKER_CONTAINERD_BUILD_FLAGS) \
+ ./cmd/$(d)$(sep)
+ )
endef
define DOCKER_CONTAINERD_INSTALL_TARGET_CMDS
--
2.9.0.windows.1

View File

@ -0,0 +1,74 @@
From 6a48f06457a12bd306ca721c7c673183c3a62783 Mon Sep 17 00:00:00 2001
From: Christian Stewart <christian@paral.in>
Date: Wed, 20 Sep 2017 03:10:11 +0100
Subject: [PATCH] runc: bump to 9f9c96235cc
This commit bumps runc to the requisite version for Docker 2018.03.
Signed-off-by: Christian Stewart <christian@paral.in>
---
package/runc/runc.hash | 2 +-
package/runc/runc.mk | 17 +++++++++++------
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/package/runc/runc.hash b/package/runc/runc.hash
index 3e188c5..f762707 100644
--- a/package/runc/runc.hash
+++ b/package/runc/runc.hash
@@ -1,2 +1,2 @@
# Locally computed
-sha256 b5c50d7d9a5f610d5424f96196efa306ec708fd9299302dd919545099c16b7c1 runc-9c2d8d184e5da67c95d601382adf14862e4f2228.tar.gz
+sha256 df8e7cd1d332d97b468ee455164f3959246bb5fc639dd8042d0db3bded621ad7 runc-6c55f98695e902427906eed2c799e566e3d3dfb5.tar.gz
diff --git a/package/runc/runc.mk b/package/runc/runc.mk
index fb3fec2..f19fc5f 100644
--- a/package/runc/runc.mk
+++ b/package/runc/runc.mk
@@ -4,14 +4,14 @@
#
################################################################################
-RUNC_VERSION = 9c2d8d184e5da67c95d601382adf14862e4f2228
+RUNC_VERSION = 6c55f98695e902427906eed2c799e566e3d3dfb5
RUNC_SITE = $(call github,opencontainers,runc,$(RUNC_VERSION))
RUNC_LICENSE = Apache-2.0
RUNC_LICENSE_FILES = LICENSE
RUNC_DEPENDENCIES = host-go
-RUNC_GOPATH = "$(@D)/Godeps/_workspace"
+RUNC_GOPATH = $(@D)/gopath
RUNC_MAKE_ENV = $(HOST_GO_TARGET_ENV) \
CGO_ENABLED=1 \
GOBIN="$(@D)/bin" \
@@ -23,9 +23,10 @@ RUNC_GLDFLAGS = \
ifeq ($(BR2_STATIC_LIBS),y)
RUNC_GLDFLAGS += -extldflags '-static'
+RUNC_GOTAGS += static_build
endif
-RUNC_GOTAGS = cgo static_build
+RUNC_GOTAGS = cgo
ifeq ($(BR2_PACKAGE_LIBSECCOMP),y)
RUNC_GOTAGS += seccomp
@@ -38,9 +39,13 @@ define RUNC_CONFIGURE_CMDS
endef
define RUNC_BUILD_CMDS
- cd $(@D) && $(RUNC_MAKE_ENV) $(HOST_DIR)/bin/go \
- build -v -o $(@D)/bin/runc \
- -tags "$(RUNC_GOTAGS)" -ldflags "$(RUNC_GLDFLAGS)" .
+ cd $(RUNC_GOPATH)/src/github.com/opencontainers/runc; \
+ $(RUNC_MAKE_ENV) \
+ $(HOST_DIR)/bin/go build -v -i \
+ -o $(@D)/bin/runc \
+ -tags "$(RUNC_GOTAGS)" \
+ -ldflags "$(RUNC_GLDFLAGS)" \
+ ./
endef
define RUNC_INSTALL_TARGET_CMDS
--
2.9.0.windows.1

View File

@ -0,0 +1,92 @@
From 16fc5c50a96aad21f8f6b8db202269cc8fee1c36 Mon Sep 17 00:00:00 2001
From: Christian Stewart <christian@paral.in>
Date: Tue, 9 May 2017 18:03:55 -0400
Subject: [PATCH] docker-engine: add support for init processes
When a docker container is run with the --init flag, the Docker engine
uses the docker-init binary as PID 1 inside the container. This is
necessary in may cases to avoid issues with signal handling, zombie
processes, and other quirks when running as PID 1.
The docker-init binary is backed by tini on default, but optionally can
be changed to docker-init by user preference.
Furthermore, this patch fixes the following Docker error:
dockerd: level=warning msg="failed to retrieve docker-init version"
Signed-off-by: Christian Stewart <christian@paral.in>
---
package/docker-engine/Config.in | 26 ++++++++++++++++++++++++++
package/docker-engine/docker-engine.mk | 11 +++++++++++
2 files changed, 37 insertions(+)
diff --git a/package/docker-engine/Config.in b/package/docker-engine/Config.in
index 05670a7..7d9a87f 100644
--- a/package/docker-engine/Config.in
+++ b/package/docker-engine/Config.in
@@ -33,6 +33,32 @@ config BR2_PACKAGE_DOCKER_ENGINE_STATIC_CLIENT
if BR2_PACKAGE_DOCKER_ENGINE_DAEMON
+choice
+ bool "docker-init to use"
+ default BR2_PACKAGE_DOCKER_ENGINE_INIT_TINI
+ help
+ The docker engine uses a minimal init process as PID 1
+ inside containers. There are several implementations
+ of this init process.
+
+config BR2_PACKAGE_DOCKER_ENGINE_INIT_TINI
+ bool "tini"
+ select BR2_PACKAGE_TINI
+ help
+ Use Tini as the container init process.
+
+ https://github.com/krallin/tini
+
+config BR2_PACKAGE_DOCKER_ENGINE_INIT_DUMB_INIT
+ bool "dumb-init"
+ select BR2_PACKAGE_DUMB_INIT
+ help
+ Use dumb-init as the container init process.
+
+ https://github.com/Yelp/dumb-init
+
+endchoice
+
config BR2_PACKAGE_DOCKER_ENGINE_DRIVER_BTRFS
bool "btrfs filesystem driver"
depends on BR2_USE_MMU # btrfs-progs
diff --git a/package/docker-engine/docker-engine.mk b/package/docker-engine/docker-engine.mk
index 8928f07..a2776ed 100644
--- a/package/docker-engine/docker-engine.mk
+++ b/package/docker-engine/docker-engine.mk
@@ -50,6 +50,13 @@ endif
ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DAEMON),y)
DOCKER_ENGINE_BUILD_TAGS += daemon
DOCKER_ENGINE_BUILD_TARGETS += dockerd
+
+ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_INIT_DUMB_INIT),y)
+DOCKER_ENGINE_INIT = dumb-init
+else
+DOCKER_ENGINE_INIT = tini
+endif
+
endif
ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_EXPERIMENTAL),y)
@@ -119,6 +126,10 @@ define DOCKER_ENGINE_INSTALL_TARGET_CMDS
$(foreach target,$(DOCKER_ENGINE_BUILD_TARGETS), \
$(INSTALL) -D -m 0755 $(@D)/bin/$(target) $(TARGET_DIR)/usr/bin/$(target)
)
+
+ $(if $(filter $(BR2_PACKAGE_DOCKER_ENGINE_DAEMON),y), \
+ ln -fs $(DOCKER_ENGINE_INIT) $(TARGET_DIR)/usr/bin/docker-init
+ )
endef
$(eval $(generic-package))
--
2.9.0.windows.1