Skip to contentSkip to conversation

Add docker engine support

PATCH Superseded Christian Stewart 4 participants 22 messages May 28, 2016 – Jul 4, 2016

v6 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v6 cover Add docker engine support

This series adds runc, docker-containerd, and docker-engine support.

The aufs graph driver is compiled for the docker-engine, but aufs and other optional graph drivers will work at runtime only if the corresponding kernel features and userspace tools are installed. This is left up to the user.

Graph driver selection has been re-enabled as of v6 as btrfs and overlayfs both require build-time headers from the corresponding utility packages.

Patch 1 adds runC, the new minimal CLI for running linux containers. Patch 2 adds docker-containerd, the daemon and API for runC. Patch 3 adds docker-engine, the cli and api for the Docker application engine.

Christian Stewart (3):
runc: new package
docker-containerd: new package
docker-engine: new package

 package/Config.in                                |   3 +
 package/docker-containerd/0001-arm64-fixes.patch | 189 +++++++++++++++++++++++
 package/docker-containerd/Config.in              |  13 ++
 package/docker-containerd/docker-containerd.hash |   2 +
 package/docker-containerd/docker-containerd.mk   |  44 ++++++
 package/docker-engine/Config.in                  |  69 +++++++++
 package/docker-engine/docker-engine.hash         |   2 +
 package/docker-engine/docker-engine.mk           |  99 ++++++++++++
 package/runc/Config.in                           |  13 ++
 package/runc/runc.hash                           |   2 +
 package/runc/runc.mk                             |  46 ++++++
 11 files changed, 482 insertions(+)
 create mode 100644 package/docker-containerd/0001-arm64-fixes.patch
 create mode 100644 package/docker-containerd/Config.in
 create mode 100644 package/docker-containerd/docker-containerd.hash
 create mode 100644 package/docker-containerd/docker-containerd.mk
 create mode 100644 package/docker-engine/Config.in
 create mode 100644 package/docker-engine/docker-engine.hash
 create mode 100644 package/docker-engine/docker-engine.mk
 create mode 100644 package/runc/Config.in
 create mode 100644 package/runc/runc.hash
 create mode 100644 package/runc/runc.mk
Signature · 1 line
2.7.3
#1 lore raw

PATCH v6 1/3 runc: new package

runC is a CLI tool for spawning and running containers according to the OCP specification.

runC is used by the latest Docker engine versions, however, runc itself is standalone and has no other dependencies.

https://runc.io/

---

Changes since v1:
- use call github to generate source url
Changes since v3:
- fix indentation in Config.in
- add dep on threads in Config.in
- break gopath into separate variable
- use HOST_GO_TARGET_ENV
Changes since v4:
- use RUNC_VERSION instead of commit hash
- only show comment when build is possible with threads enabled

---
 package/Config.in      |  1 +
 package/runc/Config.in | 13 +++++++++++++
 package/runc/runc.hash |  2 ++
 package/runc/runc.mk   | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 62 insertions(+)
 create mode 100644 package/runc/Config.in
 create mode 100644 package/runc/runc.hash
 create mode 100644 package/runc/runc.mk
package/Config.in +1 -0
index 9d668bf..6c513ba 100644
@@ -1664,6 +1664,7 @@ endif
 if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 	source "package/rsyslog/Config.in"
 endif
+	source "package/runc/Config.in"
 	source "package/scrub/Config.in"
 	source "package/scrypt/Config.in"
 	source "package/smack/Config.in"
package/runc/Config.in new file +13 -0
new file mode 100644
index 0000000..1802e59
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_RUNC
+	bool "runc"
+	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	help
+	  runC is a CLI tool for spawning and running containers
+	  according to the OCP specification.
+
+	  https://github.com/opencontainers/runc
+
+comment "runc needs a toolchain w/ threads"
+	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
package/runc/runc.hash new file +2 -0
new file mode 100644
index 0000000..c109c33
@@ -0,0 +1,2 @@
+# Locally computed
+sha256 f9955daed1e73e842b2f28a258fba51f4e72a6b4b64cc3fc06415481d55ce000  runc-v0.1.1.tar.gz
package/runc/runc.mk new file +46 -0

46 lines not on this page · raw message

Signature · 1 line
2.7.3
#2 lore raw

PATCH v6 1/3 runc: new package

Hi Christian,

Le 29/05/2016 ? 00:46, Christian Stewart a ?crit :

Quoted 9 lines

runC is a CLI tool for spawning and running containers according to the OCP specification.

runC is used by the latest Docker engine versions, however, runc itself is standalone and has no other dependencies.

https://runc.io/

Verified License and License file, build test.

Best regards,
Romain

Quoted 116 lines

---

Changes since v1:
- use call github to generate source url
Changes since v3:
- fix indentation in Config.in
- add dep on threads in Config.in
- break gopath into separate variable
- use HOST_GO_TARGET_ENV
Changes since v4:
- use RUNC_VERSION instead of commit hash
- only show comment when build is possible with threads enabled

---
 package/Config.in      |  1 +
 package/runc/Config.in | 13 +++++++++++++
 package/runc/runc.hash |  2 ++
 package/runc/runc.mk   | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 62 insertions(+)
 create mode 100644 package/runc/Config.in
 create mode 100644 package/runc/runc.hash
 create mode 100644 package/runc/runc.mk
package/Config.in +1 -0
index 9d668bf..6c513ba 100644
@@ -1664,6 +1664,7 @@ endif
 if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 	source "package/rsyslog/Config.in"
 endif
+	source "package/runc/Config.in"
 	source "package/scrub/Config.in"
 	source "package/scrypt/Config.in"
 	source "package/smack/Config.in"
package/runc/Config.in new file +13 -0
new file mode 100644
index 0000000..1802e59
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_RUNC
+	bool "runc"
+	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	help
+	  runC is a CLI tool for spawning and running containers
+	  according to the OCP specification.
+
+	  https://github.com/opencontainers/runc
+
+comment "runc needs a toolchain w/ threads"
+	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
package/runc/runc.hash new file +2 -0
new file mode 100644
index 0000000..c109c33
@@ -0,0 +1,2 @@
+# Locally computed
+sha256 f9955daed1e73e842b2f28a258fba51f4e72a6b4b64cc3fc06415481d55ce000  runc-v0.1.1.tar.gz
package/runc/runc.mk new file +46 -0
new file mode 100644
index 0000000..72b194d
@@ -0,0 +1,46 @@
+################################################################################
+#
+# runc
+#
+################################################################################
+
+RUNC_VERSION = v0.1.1
+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_MAKE_ENV = $(HOST_GO_TARGET_ENV) \
+	CGO_ENABLED=1 \
+	GOBIN="$(@D)/bin" \
+	GOPATH="$(RUNC_GOPATH)"
+
+RUNC_GLDFLAGS = \
+	-X main.gitCommit=$(RUNC_VERSION) \
+	-extldflags '-static'
+
+RUNC_GOTAGS = cgo static_build
+
+ifeq ($(BR2_PACKAGE_LIBSECCOMP),y)
+RUNC_GOTAGS += seccomp
+RUNC_DEPENDENCIES += libseccomp
+endif
+
+define RUNC_CONFIGURE_CMDS
+	mkdir -p $(RUNC_GOPATH)/src/github.com/opencontainers
+	ln -s $(@D) $(RUNC_GOPATH)/src/github.com/opencontainers/runc
+endef
+
+define RUNC_BUILD_CMDS
+	cd $(@D) && $(RUNC_MAKE_ENV) $(HOST_DIR)/usr/bin/go \
+		build -v -o $(@D)/bin/runc -tags "$(RUNC_GOTAGS)" -ldflags "$(RUNC_GLDFLAGS)" .
+endef
+
+define RUNC_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/bin/runc $(TARGET_DIR)/usr/bin/runc
+endef
+
+$(eval $(generic-package))
#3 lore raw

PATCH v6 2/3 docker-containerd: new package

In reply to Christian Stewart

docker-containerd is a daemon and API for controlling and managing runC containers.

https://containerd.tools/

---

Changes since v3:
- Don't depend on runc at compile-time
- Add threading dependency
- Use HOST_GO_TARGET_ENV, partially
- Cleanup compile commands
- Include patch to fix arm64 compilation
Changes since v4:
- Bump to v0.2.2
- update hash for 0.2.2
- fix docker-runc simlink
- use CONTAINERD_VERSION for GitCommit const
- add go arch supports to config.in comment
- did runtime tests
- added signed-off-by to the patch series

---
 package/Config.in                                |   1 +
 package/docker-containerd/0001-arm64-fixes.patch | 189 +++++++++++++++++++++++
 package/docker-containerd/Config.in              |  13 ++
 package/docker-containerd/docker-containerd.hash |   2 +
 package/docker-containerd/docker-containerd.mk   |  44 ++++++
 5 files changed, 249 insertions(+)
 create mode 100644 package/docker-containerd/0001-arm64-fixes.patch
 create mode 100644 package/docker-containerd/Config.in
 create mode 100644 package/docker-containerd/docker-containerd.hash
 create mode 100644 package/docker-containerd/docker-containerd.mk
package/Config.in +1 -0
index 6c513ba..c8365f8 100644
@@ -1631,6 +1631,7 @@ if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 	source "package/dcron/Config.in"
 	source "package/debianutils/Config.in"
 endif
+	source "package/docker-containerd/Config.in"
 	source "package/cgroupfs-mount/Config.in"
 	source "package/dsp-tools/Config.in"
 	source "package/emlog/Config.in"
package/docker-containerd/0001-arm64-fixes.patch new file +189 -0

189 lines not on this page · raw message

package/docker-containerd/Config.in new file +13 -0
new file mode 100644
index 0000000..e76a6a2
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_DOCKER_CONTAINERD
+	bool "docker-containerd"
+	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	select BR2_PACKAGE_RUNC
+	help
+	  containerd is a daemon to control runC.
+
+	  https://github.com/docker/containerd
+
+comment "docker-containerd needs a toolchain w/ threads"
+	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
package/docker-containerd/docker-containerd.hash new file +2 -0
new file mode 100644
index 0000000..b98e651
@@ -0,0 +1,2 @@
+# Computed locally
+sha256 a21efc7ea4bb97306ae9807caadca6782358679f38d3afd606cb599b6853bc52  docker-containerd-v0.2.2.tar.gz
package/docker-containerd/docker-containerd.mk new file +44 -0

44 lines not on this page · raw message

Signature · 1 line
2.7.3
#4 lore raw

PATCH v6 2/3 docker-containerd: new package

package/docker-containerd/docker-containerd.mk line 42

Quoted 9 lines

-----Original Message-----
From: buildroot [mailto:buildroot-bounces at busybox.net] On Behalf Of Christian Stewart
Sent: Saturday, May 28, 2016 6:46 PM

package/docker-containerd/docker-containerd.mk new file +5 -0
+define DOCKER_CONTAINERD_INSTALL_TARGET_CMDS
+	ln -fs runc $(TARGET_DIR)/usr/bin/docker-runc
+	$(INSTALL) -D -m 0755 $(@D)/bin/containerd $(TARGET_DIR)/usr/bin/docker-containerd
+	$(INSTALL) -D -m 0755 $(@D)/bin/containerd-shim $(TARGET_DIR)/usr/bin/containerd-shim
+endef

Should this target be $(TARGET_DIR)/usr/bin/docker-containerd-shim instead?

#5 lore raw

PATCH v6 2/3 docker-containerd: new package

Hello,

Quoted 11 lines · Andrew Webster

package/docker-containerd/docker-containerd.mk

Quoted 4 lines
package/docker-containerd/docker-containerd.mk new file +3 -0
+define DOCKER_CONTAINERD_INSTALL_TARGET_CMDS
+     ln -fs runc $(TARGET_DIR)/usr/bin/docker-runc
+     $(INSTALL) -D -m 0755 $(@D)/bin/containerd

$(TARGET_DIR)/usr/bin/docker-containerd

Quoted 1 line

+ $(INSTALL) -D -m 0755 $(@D)/bin/containerd-shim

$(TARGET_DIR)/usr/bin/containerd-shim

Quoted 1 line

+endef

Should this target be $(TARGET_DIR)/usr/bin/docker-containerd-shim instead?

Yes, and this is fixed for the next revision, see:

https://github.com/paralin/buildroot/commit/39ca2e6f7ce4e23c2a9ff0016ff3680299b4f91b

~ Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160607/6d5541c7/attachment.html>

#6 lore raw

PATCH v6 2/3 docker-containerd: new package

In reply to Christian Stewart

Hi Christian,

Le 29/05/2016 ? 00:46, Christian Stewart a ?crit :

Quoted 54 lines

docker-containerd is a daemon and API for controlling and managing runC containers.

https://containerd.tools/

---

Changes since v3:
- Don't depend on runc at compile-time
- Add threading dependency
- Use HOST_GO_TARGET_ENV, partially
- Cleanup compile commands
- Include patch to fix arm64 compilation
Changes since v4:
- Bump to v0.2.2
- update hash for 0.2.2
- fix docker-runc simlink
- use CONTAINERD_VERSION for GitCommit const
- add go arch supports to config.in comment
- did runtime tests
- added signed-off-by to the patch series

---
 package/Config.in                                |   1 +
 package/docker-containerd/0001-arm64-fixes.patch | 189 +++++++++++++++++++++++
 package/docker-containerd/Config.in              |  13 ++
 package/docker-containerd/docker-containerd.hash |   2 +
 package/docker-containerd/docker-containerd.mk   |  44 ++++++
 5 files changed, 249 insertions(+)
 create mode 100644 package/docker-containerd/0001-arm64-fixes.patch
 create mode 100644 package/docker-containerd/Config.in
 create mode 100644 package/docker-containerd/docker-containerd.hash
 create mode 100644 package/docker-containerd/docker-containerd.mk
package/Config.in +1 -0
index 6c513ba..c8365f8 100644
@@ -1631,6 +1631,7 @@ if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 	source "package/dcron/Config.in"
 	source "package/debianutils/Config.in"
 endif
+	source "package/docker-containerd/Config.in"
 	source "package/cgroupfs-mount/Config.in"
 	source "package/dsp-tools/Config.in"
 	source "package/emlog/Config.in"
package/docker-containerd/0001-arm64-fixes.patch new file +0 -0
new file mode 100644
index 0000000..19df02c

package/docker-containerd/0001-arm64-fixes.patch line 8

Quoted 8 lines
package/docker-containerd/0001-arm64-fixes.patch new file +8 -0
@@ -0,0 +1,189 @@
+From f6f54370d154b0ce5f35319d878048d7db8db89c Mon Sep 17 00:00:00 2001
+From: Lei Jitang <[email protected]>
+Date: Tue, 5 Apr 2016 23:17:30 -0400
+Subject: [PATCH] arm64 fixes
+
+This commit is a combination of a few cherry-picked commits from the
+current master (0.3.0 candidate) of docker-containerd, which
+specifically address issues under arm64.

It would be good to not squash several patches into one. It would be easier to rework the patch during a version bump.

Quoted 187 lines
package/docker-containerd/0001-arm64-fixes.patch new file +181 -0
+
+move epoll syscall to arch specific to enable containerd run on arm64
+Rename epoll_amd64.go to epoll.go
+Signed-off-by: Lei Jitang <[email protected]>
+
+archutils: epoll_aarch64: fix C formatting
+Signed-off-by: Aleksa Sarai <[email protected]>
+
+archutils: fix build on aarch64
+Signed-off-by: Aleksa Sarai <[email protected]>
+
+Use flag for aarch64 EpollCreate1
+Signed-off-by: Qiang Huang <[email protected]>
+
+Correct build flag for arm64
+Signed-off-by: Qiang Huang <[email protected]>
+
+Series signature:
+
+Signed-off-by: Christian Stewart <[email protected]>
+
+---
+ archutils/epoll.go          | 19 ++++++++++++
+ archutils/epoll_arm64.go    | 70 +++++++++++++++++++++++++++++++++++++++++++++
+ supervisor/monitor_linux.go |  9 +++---
+ 3 files changed, 94 insertions(+), 4 deletions(-)
+ create mode 100644 archutils/epoll.go
+ create mode 100644 archutils/epoll_arm64.go
+
+diff --git a/archutils/epoll.go b/archutils/epoll.go
+new file mode 100644
+index 0000000..c8ade64
+--- /dev/null
++++ b/archutils/epoll.go
+@@ -0,0 +1,19 @@
++// +build linux,!arm64
++
++package archutils
++
++import (
++	"syscall"
++)
++
++func EpollCreate1(flag int) (int, error) {
++	return syscall.EpollCreate1(flag)
++}
++
++func EpollCtl(epfd int, op int, fd int, event *syscall.EpollEvent) error {
++	return syscall.EpollCtl(epfd, op, fd, event)
++}
++
++func EpollWait(epfd int, events []syscall.EpollEvent, msec int) (int, error) {
++	return syscall.EpollWait(epfd, events, msec)
++}
+diff --git a/archutils/epoll_arm64.go b/archutils/epoll_arm64.go
+new file mode 100644
+index 0000000..00abc68
+--- /dev/null
++++ b/archutils/epoll_arm64.go
+@@ -0,0 +1,70 @@
++// +build linux,arm64
++
++package archutils
++
++// #include <sys/epoll.h>
++/*
++int EpollCreate1(int flag) {
++	return epoll_create1(flag);
++}
++
++int EpollCtl(int efd, int op,int sfd, int events, int fd) {
++	struct epoll_event event;
++	event.events = events;
++	event.data.fd = fd;
++
++	return epoll_ctl(efd, op, sfd, &event);
++}
++
++struct event_t {
++	uint32_t events;
++	int fd;
++};
++
++struct epoll_event events[128];
++int run_epoll_wait(int fd, struct event_t *event) {
++	int n, i;
++	n = epoll_wait(fd, events, 128, -1);
++	for (i = 0; i < n; i++) {
++		event[i].events = events[i].events;
++		event[i].fd = events[i].data.fd;
++	}
++	return n;
++}
++*/
++import "C"
++
++import (
++	"fmt"
++	"syscall"
++	"unsafe"
++)
++
++func EpollCreate1(flag int) (int, error) {
++	fd := int(C.EpollCreate1(C.int(flag)))
++	if fd < 0 {
++		return fd, fmt.Errorf("failed to create epoll, errno is %d", fd)
++	}
++	return fd, nil
++}
++
++func EpollCtl(epfd int, op int, fd int, event *syscall.EpollEvent) error {
++	errno := C.EpollCtl(C.int(epfd), C.int(syscall.EPOLL_CTL_ADD), C.int(fd), C.int(event.Events), C.int(event.Fd))
++	if errno < 0 {
++		return fmt.Errorf("Failed to ctl epoll")
++	}
++	return nil
++}
++
++func EpollWait(epfd int, events []syscall.EpollEvent, msec int) (int, error) {
++	var c_events [128]C.struct_event_t
++	n := int(C.run_epoll_wait(C.int(epfd), (*C.struct_event_t)(unsafe.Pointer(&c_events))))
++	if n < 0 {
++		return int(n), fmt.Errorf("Failed to wait epoll")
++	}
++	for i := 0; i < n; i++ {
++		events[i].Fd = int32(c_events[i].fd)
++		events[i].Events = uint32(c_events[i].events)
++	}
++	return int(n), nil
++}
+diff --git a/supervisor/monitor_linux.go b/supervisor/monitor_linux.go
+index adf4ffd..b176585 100644
+--- a/supervisor/monitor_linux.go
++++ b/supervisor/monitor_linux.go
+@@ -5,6 +5,7 @@ import (
+ 	"syscall"
+ 
+ 	"github.com/Sirupsen/logrus"
++	"github.com/docker/containerd/archutils"
+ 	"github.com/docker/containerd/runtime"
+ )
+ 
+@@ -14,7 +15,7 @@ func NewMonitor() (*Monitor, error) {
+ 		exits:     make(chan runtime.Process, 1024),
+ 		ooms:      make(chan string, 1024),
+ 	}
+-	fd, err := syscall.EpollCreate1(0)
++	fd, err := archutils.EpollCreate1(0)
+ 	if err != nil {
+ 		return nil, err
+ 	}
+@@ -47,7 +48,7 @@ func (m *Monitor) Monitor(p runtime.Process) error {
+ 		Fd:     int32(fd),
+ 		Events: syscall.EPOLLHUP,
+ 	}
+-	if err := syscall.EpollCtl(m.epollFd, syscall.EPOLL_CTL_ADD, fd, &event); err != nil {
++	if err := archutils.EpollCtl(m.epollFd, syscall.EPOLL_CTL_ADD, fd, &event); err != nil {
+ 		return err
+ 	}
+ 	EpollFdCounter.Inc(1)
+@@ -67,7 +68,7 @@ func (m *Monitor) MonitorOOM(c runtime.Container) error {
+ 		Fd:     int32(fd),
+ 		Events: syscall.EPOLLHUP | syscall.EPOLLIN,
+ 	}
+-	if err := syscall.EpollCtl(m.epollFd, syscall.EPOLL_CTL_ADD, fd, &event); err != nil {
++	if err := archutils.EpollCtl(m.epollFd, syscall.EPOLL_CTL_ADD, fd, &event); err != nil {
+ 		return err
+ 	}
+ 	EpollFdCounter.Inc(1)
+@@ -82,7 +83,7 @@ func (m *Monitor) Close() error {
+ func (m *Monitor) start() {
+ 	var events [128]syscall.EpollEvent
+ 	for {
+-		n, err := syscall.EpollWait(m.epollFd, events[:], -1)
++		n, err := archutils.EpollWait(m.epollFd, events[:], -1)
+ 		if err != nil {
+ 			if err == syscall.EINTR {
+ 				continue
+-- 
+2.7.3
+
package/docker-containerd/Config.in new file +0 -0
new file mode 100644
index 0000000..e76a6a2

package/docker-containerd/Config.in line 5

Quoted 5 lines
package/docker-containerd/Config.in new file +5 -0
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_DOCKER_CONTAINERD
+	bool "docker-containerd"
+	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	select BR2_PACKAGE_RUNC

Please, add a comment to say that runc is a runtime dependency.

Best regards,
Romain

Quoted 67 lines
package/docker-containerd/Config.in new file +8 -0
+	help
+	  containerd is a daemon to control runC.
+
+	  https://github.com/docker/containerd
+
+comment "docker-containerd needs a toolchain w/ threads"
+	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
package/docker-containerd/docker-containerd.hash new file +2 -0
new file mode 100644
index 0000000..b98e651
@@ -0,0 +1,2 @@
+# Computed locally
+sha256 a21efc7ea4bb97306ae9807caadca6782358679f38d3afd606cb599b6853bc52  docker-containerd-v0.2.2.tar.gz
package/docker-containerd/docker-containerd.mk new file +44 -0
new file mode 100644
index 0000000..902d63f
@@ -0,0 +1,44 @@
+################################################################################
+#
+# docker-containerd
+#
+################################################################################
+
+DOCKER_CONTAINERD_VERSION = v0.2.2
+DOCKER_CONTAINERD_SITE = $(call github,docker,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_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) \
+	-extldflags '-static'
+
+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/opencontainers
+	ln -s $(RUNC_SRCDIR) $(DOCKER_CONTAINERD_GOPATH)/src/github.com/opencontainers/runc
+endef
+
+define DOCKER_CONTAINERD_BUILD_CMDS
+	cd $(@D); $(DOCKER_CONTAINERD_MAKE_ENV) $(HOST_DIR)/usr/bin/go build -v -o $(@D)/bin/ctr -ldflags "$(DOCKER_CONTAINERD_GLDFLAGS)" ./ctr
+	cd $(@D); $(DOCKER_CONTAINERD_MAKE_ENV) $(HOST_DIR)/usr/bin/go build -v -o $(@D)/bin/containerd -ldflags "$(DOCKER_CONTAINERD_GLDFLAGS)" ./containerd
+	cd $(@D); $(DOCKER_CONTAINERD_MAKE_ENV) $(HOST_DIR)/usr/bin/go build -v -o $(@D)/bin/containerd-shim -ldflags "$(DOCKER_CONTAINERD_GLDFLAGS)" ./containerd-shim
+endef
+
+define DOCKER_CONTAINERD_INSTALL_TARGET_CMDS
+	ln -fs runc $(TARGET_DIR)/usr/bin/docker-runc
+	$(INSTALL) -D -m 0755 $(@D)/bin/containerd $(TARGET_DIR)/usr/bin/docker-containerd
+	$(INSTALL) -D -m 0755 $(@D)/bin/containerd-shim $(TARGET_DIR)/usr/bin/containerd-shim
+endef
+
+$(eval $(generic-package))
#7 lore raw

PATCH v6 3/3 docker-engine: new package

In reply to Christian Stewart

Docker is a platform to build, ship, and run applications in portable containers.

---

Changes since v1:
- use call github to build source URL
Changes since v3:
- fix help indentation in Config.in
- use HOST_GO_TARGET_ENV as a base for build env vars
- cleanup build commands
- cleanup GOPATH and vendor directory setup
- Remove selections for graph drivers. Docker will gracefully degrade at runtime to the best available graphdriver. It is unnecessary to disable these at build time, or to pull in any other dependencies like aufs-util or btrfs tools. The daemon will use whatever is available at runtime.
Changes since v4:
- remove commit hash from version scheme
Changes since v5:
- re-introduce graphdriver selections
- these selections are required for btrfs and devicemapper
- there are buildtime dependencies on headers.
- add BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS dep to threading comment

---
 package/Config.in                        |  1 +
 package/docker-engine/Config.in          | 69 ++++++++++++++++++++++
 package/docker-engine/docker-engine.hash |  2 +
 package/docker-engine/docker-engine.mk   | 99 ++++++++++++++++++++++++++++++++
 4 files changed, 171 insertions(+)
 create mode 100644 package/docker-engine/Config.in
 create mode 100644 package/docker-engine/docker-engine.hash
 create mode 100644 package/docker-engine/docker-engine.mk
package/Config.in +1 -0
index c8365f8..b829075 100644
@@ -1632,6 +1632,7 @@ if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 	source "package/debianutils/Config.in"
 endif
 	source "package/docker-containerd/Config.in"
+	source "package/docker-engine/Config.in"
 	source "package/cgroupfs-mount/Config.in"
 	source "package/dsp-tools/Config.in"
 	source "package/emlog/Config.in"
package/docker-engine/Config.in new file +69 -0

69 lines not on this page · raw message

package/docker-engine/docker-engine.hash new file +2 -0
new file mode 100644
index 0000000..7b93669
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256 04de3750738b6f888f03520fb67db22e95e8a8e016ae901428e6c5791c9841cc  docker-engine-v1.11.1.tar.gz
package/docker-engine/docker-engine.mk new file +99 -0

99 lines not on this page · raw message

Signature · 1 line
2.7.3
#8 lore raw

PATCH v6 3/3 docker-engine: new package

Christian,

Nice work. This opens some interesting possibilities.

See comments below.

Quoted 14 lines

-----Original Message-----
From: buildroot [mailto:buildroot-bounces at busybox.net] On Behalf Of Christian Stewart
Sent: Saturday, May 28, 2016 6:46 PM

package/docker- renamed from package/docker-engine/Config.in +0 -0

engine/Config.in new file mode 100644 index 0000000..bbf56b1

package/docker-engine/Config.in new file +4 -0
@@ -0,0 +1,69 @@
+config BR2_PACKAGE_DOCKER_ENGINE
+	bool "docker-engine"
+	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
+	depends on BR2_TOOLCHAIN_HAS_THREADS

package/docker-engine/Config.in line 14

Quoted 10 lines
package/docker-engine/Config.in new file +10 -0
+	depends on BR2_USE_MMU # util-linux
+	depends on BR2_USE_WCHAR # util-linux
+	select BR2_PACKAGE_DOCKER_CONTAINERD
+	select BR2_PACKAGE_RUNC
+	select BR2_PACKAGE_SQLITE
+	select BR2_PACKAGE_UTIL_LINUX
+	select BR2_PACKAGE_UTIL_LINUX_BINARIES
+	select BR2_PACKAGE_UTIL_LINUX_PIVOT_ROOT
+	select BR2_PACKAGE_UTIL_LINUX_MOUNTPOINT
+	select BR2_PACKAGE_UTIL_LINUX_MOUNT

Does it makes sense to also add selects for BR2_PACKAGE_IPTABLES and BR2_PACKAGE_CA_CERTIFICATES here? They are not build dependencies, but run-time dependencies. It may be possible to do some things without the certificates, but I think iptables is always required.

On a similar topic, docker expects a bunch of cgroup mounts to exist somewhere on the system. Is this something that should be left up to the rootfs author (in which case maybe the help could be extended to explain this), or should the docker-engine recipe attempt to modify fstab somehow? I'm not sure if there is a way to actually do that though.

package/docker-engine/Config.in line 23

Quoted 9 lines
package/docker-engine/Config.in new file +9 -0
+	help
+	  Docker is a platform to build, ship,
+	  and run applications as lightweight containers.
+
+	  https://github.com/docker/docker
+
+comment "docker-engine needs a toolchain w/ threads"
+	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
+	depends on !BR2_TOOLCHAIN_HAS_THREADS

This comment should probably be moved to the top so that the items in the below "if" are organized as children of DOCKER_ENGINE in the config GUI's.

Quoted 150 lines
package/docker-engine/Config.in new file +46 -0
+
+if BR2_PACKAGE_DOCKER_ENGINE
+
+config BR2_PACKAGE_DOCKER_ENGINE_DAEMON
+	bool "docker daemon"
+	default y
+	help
+	  Build the Docker system daemon.
+	  If not selected, will build client only.
+
+config BR2_PACKAGE_DOCKER_ENGINE_EXPERIMENTAL
+	bool "build experimental features"
+
+if BR2_PACKAGE_DOCKER_ENGINE_DAEMON
+
+config BR2_PACKAGE_DOCKER_ENGINE_DRIVER_BTRFS
+	bool "btrfs filesystem driver"
+	depends on BR2_USE_WCHAR # btrfs-progs
+	depends on BR2_USE_MMU # btrfs-progs
+	depends on BR2_TOOLCHAIN_HAS_THREADS # btrfs-progs
+	select BR2_PACKAGE_BTRFS_PROGS
+	help
+	  Build the btrfs filesystem driver for Docker.
+
+config BR2_PACKAGE_DOCKER_ENGINE_DRIVER_DEVICEMAPPER
+	bool "devicemapper filesystem driver"
+	depends on BR2_TOOLCHAIN_HAS_THREADS # lvm2
+	depends on BR2_USE_MMU # lvm2
+	depends on !BR2_STATIC_LIBS # lvm2
+	select BR2_PACKAGE_LVM2
+	select BR2_PACKAGE_LVM2_APP_LIBRARY
+	help
+	  Build the devicemapper filesystem driver for Docker.
+
+config BR2_PACKAGE_DOCKER_ENGINE_DRIVER_VFS
+	bool "vfs filesystem driver"
+	depends on BR2_USE_WCHAR # gvfs
+	depends on BR2_USE_MMU # gvfs
+	depends on BR2_TOOLCHAIN_HAS_THREADS # gvfs
+	select BR2_PACKAGE_GVFS
+	help
+	  Build the vfs filesystem driver for Docker.
+
+endif
+
+endif
package/docker- renamed from package/docker-engine/docker-engine.mk +0 -0

engine/docker-engine.mk
new file mode 100644
index 0000000..b7407b2

package/docker-engine/docker-engine.mk new file +1 -0
@@ -0,0 +1,99 @@
+#########################################################

##############

package/docker-engine/docker-engine.mk new file +5 -0
+#########
+#
+# docker-engine
+#
+#########################################################

##############

package/docker-engine/docker-engine.mk new file +38 -0
+#########
+
+DOCKER_ENGINE_VERSION = v1.11.1
+DOCKER_ENGINE_SITE = $(call
+github,docker,docker,$(DOCKER_ENGINE_VERSION))
+
+DOCKER_ENGINE_LICENSE = Apache-2.0
+DOCKER_ENGINE_LICENSE_FILES = LICENSE
+
+DOCKER_ENGINE_DEPENDENCIES = host-go docker-containerd
+
+DOCKER_ENGINE_GOPATH = "$(@D)/vendor"
+DOCKER_ENGINE_MAKE_ENV = $(HOST_GO_TARGET_ENV) \
+	CGO_ENABLED=1 \
+	CGO_NO_EMULATION=1 \
+	GOBIN="$(@D)/bin" \
+	GOPATH="$(DOCKER_ENGINE_GOPATH)"
+
+DOCKER_ENGINE_GLDFLAGS = \
+	-X main.GitCommit=$(DOCKER_ENGINE_VERSION) \
+	-X main.Version=$(DOCKER_ENGINE_VERSION) \
+	-extldflags '-static'
+
+DOCKER_ENGINE_BUILD_TAGS = cgo exclude_graphdriver_zfs
+
+ifeq ($(BR2_PACKAGE_LIBSECCOMP),y)
+DOCKER_ENGINE_BUILD_TAGS += seccomp
+DOCKER_ENGINE_DEPENDENCIES += libseccomp endif
+
+ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DAEMON),y)
+DOCKER_ENGINE_BUILD_TAGS += daemon
+endif
+
+ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_EXPERIMENTAL),y)
+DOCKER_ENGINE_BUILD_TAGS += experimental endif
+
+ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DRIVER_BTRFS),y)
+DOCKER_ENGINE_DEPENDENCIES += btrfs-progs else

DOCKER_ENGINE_BUILD_TAGS
++= exclude_graphdriver_btrfs endif

package/docker-engine/docker-engine.mk new file +5 -0
+
+ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DRIVER_DEVICEMAPPER),y)
+DOCKER_ENGINE_DEPENDENCIES += lvm2
+else
+DOCKER_ENGINE_BUILD_TAGS += exclude_graphdriver_devicemapper

endif

package/docker-engine/docker-engine.mk new file +11 -0
+
+ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DRIVER_VFS),y)
+DOCKER_ENGINE_DEPENDENCIES += gvfs
+else
+DOCKER_ENGINE_BUILD_TAGS += exclude_graphdriver_vfs endif
+
+define DOCKER_ENGINE_CONFIGURE_CMDS
+	$(SED) '/^clean$$/d' $(@D)/hack/vendor.sh
+	cd $(@D) && bash ./hack/vendor.sh
+	mkdir -p $(DOCKER_ENGINE_GOPATH)/src/github.com/docker
+	ln -fs $(@D)

$(DOCKER_ENGINE_GOPATH)/src/github.com/docker/docker

package/docker-engine/docker-engine.mk new file +1 -0
+	ln -fs $(DOCKER_CONTAINERD_SRCDIR)

$(DOCKER_ENGINE_GOPATH)/src/github.com/docker/containerd

package/docker-engine/docker-engine.mk new file +1 -0
+	mkdir -p

$(DOCKER_ENGINE_GOPATH)/src/github.com/opencontainers

package/docker-engine/docker-engine.mk new file +6 -0
+	ln -fs $(RUNC_SRCDIR)
+$(DOCKER_ENGINE_GOPATH)/src/github.com/opencontainers/runc
+endef
+
+define DOCKER_ENGINE_BUILD_CMDS
+	cd $(@D); $(DOCKER_ENGINE_MAKE_ENV) $(HOST_DIR)/usr/bin/go

build -v -o
+$(@D)/bin/docker -tags "$(DOCKER_ENGINE_BUILD_TAGS)" -ldflags +"$(DOCKER_ENGINE_GLDFLAGS)" ./docker endef

package/docker-engine/docker-engine.mk new file +3 -0
+
+define DOCKER_ENGINE_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/bin/docker

$(TARGET_DIR)/usr/bin/docker

package/docker-engine/docker-engine.mk new file +8 -0
+endef
+
+define DOCKER_ENGINE_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 0644 $(@D)/contrib/init/systemd/docker.service \
+		$(TARGET_DIR)/usr/lib/systemd/system/docker.service
+	$(INSTALL) -D -m 0644 $(@D)/contrib/init/systemd/docker.socket \
+		$(TARGET_DIR)/usr/lib/systemd/system/docker.socket
+	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-

user.target.wants/

package/docker-engine/docker-engine.mk new file +3 -0
+	ln -fs ../../../../usr/lib/systemd/system/docker.service \
+
+$(TARGET_DIR)/etc/systemd/system/multi-

user.target.wants/docker.service

package/docker-engine/docker-engine.mk line 90

Quoted 5 lines
package/docker-engine/docker-engine.mk new file +5 -0
+endef
+
+define DOCKER_ENGINE_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 755 $(@D)/contrib/init/sysvinit-redhat/docker \
+		$(TARGET_DIR)/etc/init.d/S61docker

This init file didn't work for me. I'm not sure if it can work on a buildroot filesystem, are you using systemd instead?
I removed most of the checks to get it working (actually, I think I started editing the Ubuntu version). Maybe a custom init script is required? I can show you my hack if you like.

package/docker-engine/docker-engine.mk line 99

Quoted 9 lines
package/docker-engine/docker-engine.mk new file +1 -0
+	$(INSTALL) -D -m 644 $(@D)/contrib/init/sysvinit-

redhat/docker.sysconfig \

package/docker-engine/docker-engine.mk new file +7 -0
+		$(TARGET_DIR)/etc/sysconfig/docker.sysconfig
+endef
+
+define DOCKER_ENGINE_USERS
+	- - docker -1 * - - - Docker Application Container Framework endef
+
+$(eval $(generic-package)) 

Andrew

#9 lore raw

PATCH v6 3/3 docker-engine: new package

Hello,

Thanks for your feedback. However, it'd be nice if you could configure your e-mail client to wrap lines at a reasonable length.

Quoted 4 lines · Andrew Webster

Does it makes sense to also add selects for BR2_PACKAGE_IPTABLES and BR2_PACKAGE_CA_CERTIFICATES here? They are not build dependencies, but run-time dependencies. It may be possible to do some things without the certificates, but I think iptables is always required.

It is indeed a good idea to select the relevant runtime dependencies.

Quoted 6 lines

On a similar topic, docker expects a bunch of cgroup mounts to exist somewhere on the system. Is this something that should be left up to the rootfs author (in which case maybe the help could be extended to explain this), or should the docker-engine recipe attempt to modify fstab somehow? I'm not sure if there is a way to actually do that though.

The Buildroot philosophy is in general that things should work at least in a minimal way "out of the box". So if cgroup mounts are needed for Docker, they should be done in Docker's init script.

Quoted 10 lines

package/docker-engine/docker-engine.mk line 90

Quoted 4 lines
(quoted diff) +2 -0
+define DOCKER_ENGINE_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 755

$(@D)/contrib/init/sysvinit-redhat/docker \

package/docker-engine/docker-engine.mk new file +1 -0
+		$(TARGET_DIR)/etc/init.d/S61docker  

This init file didn't work for me. I'm not sure if it can work on a buildroot filesystem, are you using systemd instead? I removed most of the checks to get it working (actually, I think I started editing the Ubuntu version). Maybe a custom init script is required? I can show you my hack if you like.

Very often, init scripts provided by upstream for desktop/server distributions don't work really well with Buildroot generated systems. Because we don't have bash by default, because we don't necessarily have all the tools they need in our default image, and for various other reasons. That's why we generally have our own Buildroot-specific init script in the package directory.

So a custom init script is probably in order here, especially if you report that the one provided by upstream doesn't quite work.

Thanks!

Thomas

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

PATCH v6 3/3 docker-engine: new package

Quoted 4 lines

From: Thomas Petazzoni [mailto:thomas.petazzoni at free-electrons.com]
Sent: Tuesday, June 07, 2016 3:55 PM

Thanks for your feedback. However, it'd be nice if you could configure your e-mail client to wrap lines at a reasonable length.

Sorry, I just noticed that. It's also mangling some of the incoming text as well. I'll try and figure that out.

Quoted 9 lines
Quoted 6 lines

On a similar topic, docker expects a bunch of cgroup mounts to exist somewhere on the system. Is this something that should be left up to the rootfs author (in which case maybe the help could be extended to explain this), or should the docker-engine recipe attempt to modify fstab somehow? I'm not sure if there is a way to actually do that though.

The Buildroot philosophy is in general that things should work at least in a minimal way "out of the box". So if cgroup mounts are needed for Docker, they should be done in Docker's init script.

Ahh, right. I missed that part when I made my custom init. The debian/redhat versions do attempt to do this.

#11 lore raw

PATCH v6 3/3 docker-engine: new package

In reply to Thomas Petazzoni

Thomas, Andrew,

Quoted 6 lines · Thomas Petazzoni
Quoted 5 lines

Does it makes sense to also add selects for BR2_PACKAGE_IPTABLES and BR2_PACKAGE_CA_CERTIFICATES here? They are not build dependencies, but run-time dependencies. It may be possible to do some things without the certificates, but I think iptables is always required.

Not sure if these are actually required. The iptables calls are direct, not through calling a cli.

Certs are a different story but that might be out of the scope of the Docker package. It can run stuff locally without hitting the internet at all.

Quoted 7 lines

On a similar topic, docker expects a bunch of cgroup mounts to exist

Quoted 5 lines

somewhere on the system. Is this something that should be left up to the rootfs author (in which case maybe the help could be extended to explain this), or should the docker-engine recipe attempt to modify fstab somehow? I'm not sure if there is a way to actually do that though.

This is unnecessary. On all of the systems I'm running, with NO fstab modifications or really anything but enabling the Docker package, it works fine. Docker might be doing the mounting automatically.

Quoted 11 lines
Quoted 10 lines

+define DOCKER_ENGINE_INSTALL_INIT_SYSV

Quoted 3 lines

+ $(INSTALL) -D -m 755
$(@D)/contrib/init/sysvinit-redhat/docker \
+ $(TARGET_DIR)/etc/init.d/S61docker

This init file didn't work for me. I'm not sure if it can work on a buildroot filesystem, are you using systemd instead? I removed most of the checks to get it working (actually, I think I started editing the Ubuntu version). Maybe a custom init script is required? I can show you my hack if you like.

I didn't expect this to work, and was hoping someone who's not using systemd would contribute a better init script for it.

I'd appreciate seeing your script if you manage to get one that works well for you under Buildroot's shell based init sequence.

So a custom init script is probably in order here, especially if you

Quoted 2 lines

report that the one provided by upstream doesn't quite work.

+1

For reference, here's my system setup: http://github.com/paralin/SkiffOS

It's actually a very extensible configuration generation platform, I'm hoping to expand its scope soon, if anyone would like to
have a look and give me any comments, they would be greatly appreciated :)

Thanks!
Christian Stewart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160607/e99897ea/attachment.html>

#12 lore raw

PATCH v6 3/3 docker-engine: new package

Quoted 9 lines

From: Christian Stewart [mailto:christian at paral.in]
Sent: Tuesday, June 07, 2016 4:18 PM

Quoted 4 lines

Does it makes sense to also add selects for BR2_PACKAGE_IPTABLES and BR2_PACKAGE_CA_CERTIFICATES here?? They are not build dependencies, but run-time dependencies.? It may be possible to do some things without the certificates, but I think iptables is always required.

Not sure if these are actually required. The iptables calls are direct, not through calling a cli.

On my system, if I don't have the iptables executable in the path, docker fails to start with the following:

FATA[0001] Error starting daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain: Iptables not found

Have I misconfigured something?

Quoted 1 line

Certs are a different story but that might be out of the scope of the Docker package. It can run stuff locally without hitting the internet at all.

Yup. I guess there's no formal way to "recommend" a package.

Quoted 8 lines
Quoted 6 lines

On a similar topic, docker expects a bunch of cgroup mounts to exist somewhere on the system.? Is this something that should be left up to the rootfs author (in which case maybe the help could be extended to explain this), or should the docker-engine recipe attempt to modify fstab somehow?? I'm not sure if there is a way to actually do that though.

This is unnecessary. On all of the systems I'm running, with NO fstab modifications or really anything but enabling the Docker package, it works fine. Docker might be doing the mounting automatically.

You are correct. This was my fault, I missed doing the mounts in the init. Let me correct it, then I'll send it out.

Andrew

#13 lore raw

PATCH v6 3/3 docker-engine: new package

Hello,

Quoted 5 lines · Andrew Webster
Quoted 3 lines

Certs are a different story but that might be out of the scope of the Docker package. It can run stuff locally without hitting the internet at all.

Yup. I guess there's no formal way to "recommend" a package.

The best thing we can do in the context of Buildroot is to add a note in the help text of the package in its Config.in file.

Something like:

Make sure to enable the ca-certificates package if you want docker-engine to be able to ....

Best regards,

Thomas

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

PATCH v6 3/3 docker-engine: new package

Here is a patch with the init file I used. I copied the contrib/init/sysvinit-debian/docker file and modified it slightly.

In start), the stdout/stderr of start-stop-daemon is logged to $DOCKER_LOGFILE. I suspect that the intention was to actually log the stdout/stderr of docker, not start-stop-daemon, but I have left it as it was in the original file.

Author: Andrew Webster <[email protected]>
Date:   Mon Jun 6 14:53:08 2016 -0400

docker-engine: switch sysv init to custom file

The packaged redhat init file is not suitable for buildroot. This adds a customized version for buildroot.

package/docker-engine/docker-engine.mk +3 -3
index b7407b2..17e4516 100644
@@ -86,10 +86,10 @@ define DOCKER_ENGINE_INSTALL_INIT_SYSTEMD
 endef
 
 define DOCKER_ENGINE_INSTALL_INIT_SYSV
-    $(INSTALL) -D -m 755 $(@D)/contrib/init/sysvinit-redhat/docker \
+    $(INSTALL) -D -m 755 package/docker-engine/docker.init \
         $(TARGET_DIR)/etc/init.d/S61docker
-    $(INSTALL) -D -m 644 $(@D)/contrib/init/sysvinit-redhat/docker.sysconfig \
-        $(TARGET_DIR)/etc/sysconfig/docker.sysconfig
+    $(INSTALL) -D -m 644 $(@D)/contrib/init/sysvinit-debian/docker.default \
+        $(TARGET_DIR)/etc/default/docker
 endef
 
 define DOCKER_ENGINE_USERS
package/docker-engine/docker.init new file +111 -0

111 lines not on this page · raw message

#15 lore raw

PATCH v6 3/3 docker-engine: new package

Andrew,

Quoted 1 line · Andrew Webster

Here is a patch with the init file I used. I copied the

contrib/init/sysvinit-debian/docker file and modified it slightly.
Thank you again for this patch. It doesn't apply to my latest version of docker-engine, though. Could you have a look at my master branch at:
http://github.com/paralin/buildroot
And rebase?
I've updated Docker to the latest v1.12-rc2 which has a lot of breaking changes, so it might require some additional work from your end (sorry!)
Best, Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160627/b542d912/attachment.html>

#16 lore raw

PATCH v6 3/3 docker-engine: new package

Quoted 9 lines

From: Christian Stewart [mailto:christian at paral.in]
Sent: Monday, June 27, 2016 7:02 PM

Quoted 1 line · Andrew Webster

?Here is a patch with the init file I used.? I copied the contrib/init/sysvinit-debian/docker file and modified it slightly.

Thank you again for this patch. It doesn't apply to my latest version of docker-engine, though. Could you have a look at my master branch at:
http://github.com/paralin/buildroot
And rebase?

Patch applied cleanly to your master branch. I also have an additional patch to clean up the "restart". It may be better if I send the patches using send-email, but I don't want to CC buildroot or they will end up in patchwork. I can send directly to you instead.

Quoted 1 line

I've updated Docker to the latest v1.12-rc2 which has a lot of breaking changes, so it might require some additional work from your end (sorry!)

I haven't yet tried to build/run yet, and may not have a chance for a few days. Would you rather wait until I try it out before I send you patches?

Andrew

#17 lore raw

PATCH v6 3/3 docker-engine: new package

Hey Andrew,
On Tue, Jun 28, 2016 8:21 AM, Andrew Webster Awebster at arcx.com wrote:

Patch applied cleanly to your master branch. I also have an additional patch to clean up the ?restart?. It may be better if I send the patches using send-email, but I don't want to CC buildroot or they will end up in patchwork.

I can send directly to you instead.

Sounds good to me. Awaiting your patch.

Quoted 1 line

I've updated Docker to the latest v1.12-rc2 which has a lot of breaking

changes, so it might require some additional work from your end (sorry!)

I haven't yet tried to build/run yet, and may not have a chance for a few days. Would you rather wait until I try it out before I send you patches?

1.12 is working great now on my end. I think the only change you will need is to add a ?d? to docker because they've renamed the daemon from ?docker daemon? to just ?dockerd? by splitting it into a separate executable.
Also, they've added a lot of journald integrations and such, might be
interesting to see if we can get those working.
best, Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160628/d5548558/attachment.html>

#18 lore raw

PATCH v6 3/3 docker-engine: new package

In reply to Christian Stewart

Hi Christian,

Le 29/05/2016 ? 00:46, Christian Stewart a ?crit :

Quoted 190 lines

Docker is a platform to build, ship, and run applications in portable containers.

---

Changes since v1:
- use call github to build source URL
Changes since v3:
- fix help indentation in Config.in
- use HOST_GO_TARGET_ENV as a base for build env vars
- cleanup build commands
- cleanup GOPATH and vendor directory setup
- Remove selections for graph drivers. Docker will gracefully degrade at runtime to the best available graphdriver. It is unnecessary to disable these at build time, or to pull in any other dependencies like aufs-util or btrfs tools. The daemon will use whatever is available at runtime.
Changes since v4:
- remove commit hash from version scheme
Changes since v5:
- re-introduce graphdriver selections
- these selections are required for btrfs and devicemapper
- there are buildtime dependencies on headers.
- add BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS dep to threading comment

---
 package/Config.in                        |  1 +
 package/docker-engine/Config.in          | 69 ++++++++++++++++++++++
 package/docker-engine/docker-engine.hash |  2 +
 package/docker-engine/docker-engine.mk   | 99 ++++++++++++++++++++++++++++++++
 4 files changed, 171 insertions(+)
 create mode 100644 package/docker-engine/Config.in
 create mode 100644 package/docker-engine/docker-engine.hash
 create mode 100644 package/docker-engine/docker-engine.mk
package/Config.in +1 -0
index c8365f8..b829075 100644
@@ -1632,6 +1632,7 @@ if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 	source "package/debianutils/Config.in"
 endif
 	source "package/docker-containerd/Config.in"
+	source "package/docker-engine/Config.in"
 	source "package/cgroupfs-mount/Config.in"
 	source "package/dsp-tools/Config.in"
 	source "package/emlog/Config.in"
package/docker-engine/Config.in new file +69 -0
new file mode 100644
index 0000000..bbf56b1
@@ -0,0 +1,69 @@
+config BR2_PACKAGE_DOCKER_ENGINE
+	bool "docker-engine"
+	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_USE_MMU # util-linux
+	depends on BR2_USE_WCHAR # util-linux
+	select BR2_PACKAGE_DOCKER_CONTAINERD
+	select BR2_PACKAGE_RUNC
+	select BR2_PACKAGE_SQLITE
+	select BR2_PACKAGE_UTIL_LINUX
+	select BR2_PACKAGE_UTIL_LINUX_BINARIES
+	select BR2_PACKAGE_UTIL_LINUX_PIVOT_ROOT
+	select BR2_PACKAGE_UTIL_LINUX_MOUNTPOINT
+	select BR2_PACKAGE_UTIL_LINUX_MOUNT
+	help
+	  Docker is a platform to build, ship,
+	  and run applications as lightweight containers.
+
+	  https://github.com/docker/docker
+
+comment "docker-engine needs a toolchain w/ threads"
+	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
+
+if BR2_PACKAGE_DOCKER_ENGINE
+
+config BR2_PACKAGE_DOCKER_ENGINE_DAEMON
+	bool "docker daemon"
+	default y
+	help
+	  Build the Docker system daemon.
+	  If not selected, will build client only.
+
+config BR2_PACKAGE_DOCKER_ENGINE_EXPERIMENTAL
+	bool "build experimental features"
+
+if BR2_PACKAGE_DOCKER_ENGINE_DAEMON
+
+config BR2_PACKAGE_DOCKER_ENGINE_DRIVER_BTRFS
+	bool "btrfs filesystem driver"
+	depends on BR2_USE_WCHAR # btrfs-progs
+	depends on BR2_USE_MMU # btrfs-progs
+	depends on BR2_TOOLCHAIN_HAS_THREADS # btrfs-progs
+	select BR2_PACKAGE_BTRFS_PROGS
+	help
+	  Build the btrfs filesystem driver for Docker.
+
+config BR2_PACKAGE_DOCKER_ENGINE_DRIVER_DEVICEMAPPER
+	bool "devicemapper filesystem driver"
+	depends on BR2_TOOLCHAIN_HAS_THREADS # lvm2
+	depends on BR2_USE_MMU # lvm2
+	depends on !BR2_STATIC_LIBS # lvm2
+	select BR2_PACKAGE_LVM2
+	select BR2_PACKAGE_LVM2_APP_LIBRARY
+	help
+	  Build the devicemapper filesystem driver for Docker.
+
+config BR2_PACKAGE_DOCKER_ENGINE_DRIVER_VFS
+	bool "vfs filesystem driver"
+	depends on BR2_USE_WCHAR # gvfs
+	depends on BR2_USE_MMU # gvfs
+	depends on BR2_TOOLCHAIN_HAS_THREADS # gvfs
+	select BR2_PACKAGE_GVFS
+	help
+	  Build the vfs filesystem driver for Docker.
+
+endif
+
+endif
package/docker-engine/docker-engine.hash new file +2 -0
new file mode 100644
index 0000000..7b93669
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256 04de3750738b6f888f03520fb67db22e95e8a8e016ae901428e6c5791c9841cc  docker-engine-v1.11.1.tar.gz
package/docker-engine/docker-engine.mk new file +52 -0
new file mode 100644
index 0000000..b7407b2
@@ -0,0 +1,99 @@
+################################################################################
+#
+# docker-engine
+#
+################################################################################
+
+DOCKER_ENGINE_VERSION = v1.11.1
+DOCKER_ENGINE_SITE = $(call github,docker,docker,$(DOCKER_ENGINE_VERSION))
+
+DOCKER_ENGINE_LICENSE = Apache-2.0
+DOCKER_ENGINE_LICENSE_FILES = LICENSE
+
+DOCKER_ENGINE_DEPENDENCIES = host-go docker-containerd
+
+DOCKER_ENGINE_GOPATH = "$(@D)/vendor"
+DOCKER_ENGINE_MAKE_ENV = $(HOST_GO_TARGET_ENV) \
+	CGO_ENABLED=1 \
+	CGO_NO_EMULATION=1 \
+	GOBIN="$(@D)/bin" \
+	GOPATH="$(DOCKER_ENGINE_GOPATH)"
+
+DOCKER_ENGINE_GLDFLAGS = \
+	-X main.GitCommit=$(DOCKER_ENGINE_VERSION) \
+	-X main.Version=$(DOCKER_ENGINE_VERSION) \
+	-extldflags '-static'
+
+DOCKER_ENGINE_BUILD_TAGS = cgo exclude_graphdriver_zfs
+
+ifeq ($(BR2_PACKAGE_LIBSECCOMP),y)
+DOCKER_ENGINE_BUILD_TAGS += seccomp
+DOCKER_ENGINE_DEPENDENCIES += libseccomp
+endif
+
+ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DAEMON),y)
+DOCKER_ENGINE_BUILD_TAGS += daemon
+endif
+
+ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_EXPERIMENTAL),y)
+DOCKER_ENGINE_BUILD_TAGS += experimental
+endif
+
+ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DRIVER_BTRFS),y)
+DOCKER_ENGINE_DEPENDENCIES += btrfs-progs
+else
+DOCKER_ENGINE_BUILD_TAGS += exclude_graphdriver_btrfs
+endif
+
+ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DRIVER_DEVICEMAPPER),y)
+DOCKER_ENGINE_DEPENDENCIES += lvm2
+else
+DOCKER_ENGINE_BUILD_TAGS += exclude_graphdriver_devicemapper
+endif

package/docker-engine/docker-engine.mk line 62

Quoted 10 lines
package/docker-engine/docker-engine.mk new file +10 -0
+
+ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DRIVER_VFS),y)
+DOCKER_ENGINE_DEPENDENCIES += gvfs
+else
+DOCKER_ENGINE_BUILD_TAGS += exclude_graphdriver_vfs
+endif
+
+define DOCKER_ENGINE_CONFIGURE_CMDS
+	$(SED) '/^clean$$/d' $(@D)/hack/vendor.sh
+	cd $(@D) && bash ./hack/vendor.sh

This script clone dozen git repository

github.com/Azure/go-ansiterm
github.com/Microsoft/hcsshim
github.com/Microsoft/go-winio
github.com/Sirupsen/logrus
github.com/docker/libtrust
github.com/go-check/check
github.com/gorilla/context
github.com/gorilla/mux
github.com/kr/pty
github.com/mattn/go-shellwords
github.com/mattn/go-sqlite3
github.com/mistifyio/go-zfs
github.com/tchap/go-patricia
github.com/vdemeester/shakers
golang.org/x/net
golang.org/x/sys
github.com/docker/go-units
github.com/docker/go-connections
github.com/docker/engine-api
github.com/RackSec/srslog
github.com/imdario/mergo
github.com/docker/libnetwork
github.com/armon/go-metrics
github.com/hashicorp/go-msgpack
github.com/hashicorp/memberlist
github.com/hashicorp/serf
github.com/docker/libkv
github.com/vishvananda/netns
github.com/vishvananda/netlink
github.com/BurntSushi/toml
github.com/samuel/go-zookeeper
github.com/deckarep/golang-set
github.com/coreos/etcd
github.com/ugorji/go
github.com/hashicorp/consul
github.com/boltdb/bolt
github.com/miekg/dns
github.com/docker/distribution
github.com/vbatts/tar-split
github.com/docker/notary
google.golang.org/grpc
github.com/miekg/pkcs11
github.com/docker/go
github.com/agl/ed25519
github.com/opencontainers/runc
github.com/opencontainers/specs
github.com/seccomp/libseccomp-golang
github.com/coreos/go-systemd
github.com/godbus/dbus
github.com/syndtr/gocapability
github.com/golang/protobuf
github.com/Graylog2/go-gelf
github.com/fluent/fluent-logger-golang
github.com/philhofer/fwd
github.com/tinylib/msgp
gopkg.in/fsnotify.v1
github.com/aws/aws-sdk-go
github.com/vaughan0/go-ini
golang.org/x/oauth2
google.golang.org/api
google.golang.org/cloud
github.com/docker/containerd

You probably needs to add theses packages to Buildroot first and then fix docker-engine build system.

Best regards,
Romain

Quoted 38 lines
package/docker-engine/docker-engine.mk new file +37 -0
+	mkdir -p $(DOCKER_ENGINE_GOPATH)/src/github.com/docker
+	ln -fs $(@D) $(DOCKER_ENGINE_GOPATH)/src/github.com/docker/docker
+	ln -fs $(DOCKER_CONTAINERD_SRCDIR) $(DOCKER_ENGINE_GOPATH)/src/github.com/docker/containerd
+	mkdir -p $(DOCKER_ENGINE_GOPATH)/src/github.com/opencontainers
+	ln -fs $(RUNC_SRCDIR) $(DOCKER_ENGINE_GOPATH)/src/github.com/opencontainers/runc
+endef
+
+define DOCKER_ENGINE_BUILD_CMDS
+	cd $(@D); $(DOCKER_ENGINE_MAKE_ENV) $(HOST_DIR)/usr/bin/go build -v -o $(@D)/bin/docker -tags "$(DOCKER_ENGINE_BUILD_TAGS)" -ldflags "$(DOCKER_ENGINE_GLDFLAGS)" ./docker
+endef
+
+define DOCKER_ENGINE_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/bin/docker $(TARGET_DIR)/usr/bin/docker
+endef
+
+define DOCKER_ENGINE_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 0644 $(@D)/contrib/init/systemd/docker.service \
+		$(TARGET_DIR)/usr/lib/systemd/system/docker.service
+	$(INSTALL) -D -m 0644 $(@D)/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 \
+		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/docker.service
+endef
+
+define DOCKER_ENGINE_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 755 $(@D)/contrib/init/sysvinit-redhat/docker \
+		$(TARGET_DIR)/etc/init.d/S61docker
+	$(INSTALL) -D -m 644 $(@D)/contrib/init/sysvinit-redhat/docker.sysconfig \
+		$(TARGET_DIR)/etc/sysconfig/docker.sysconfig
+endef
+
+define DOCKER_ENGINE_USERS
+	- - docker -1 * - - - Docker Application Container Framework
+endef
+
+$(eval $(generic-package))
#19 lore raw

PATCH v6 3/3 docker-engine: new package

Romain,

Quoted 2 lines · Romain Naour

This script clone dozen git repository

That script is unnecessary and I have removed it in my newer version of this series. It's intended to be called by developers to update the vendor tree, not at build time.

Christian

Quoted 1 line

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160704/ac5a51a7/attachment.html>

#20 lore raw

PATCH v6 3/3 docker-engine: new package

Le 04/07/2016 ? 18:16, Christian Stewart a ?crit :

Quoted 11 lines

Romain,

On Mon, Jul 4, 2016, 9:13 AM Romain Naour <[email protected] <mailto:[email protected]>> wrote:

This script clone dozen git repository

That script is unnecessary and I have removed it in my newer version of this series. It's intended to be called by developers to update the vendor tree, not at build time.

Ok, great. You had some review on patch 2 and 3, I'll mark the series changes requested in the patchwork. Please, don't forget to send an updated version.

Thanks!

Best regards,
Romain

Quoted 3 lines

Christian

#21 lore raw

v6 cover Add docker engine support

In reply to Christian Stewart

All,

Quoted 1 line · Christian Stewart

This series adds runc, docker-containerd, and docker-engine support.

Quick update regarding dependencies. As of Docker v1.12-rc2 all dependency code is vendored into the Git tree itself. This means that the repo tarball actually contains all of the build-time Go dependencies in it, and no extra Git fetches are required. This should fix the problem with pulling additional code snapshots at build time.
~ Christian Stewart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160627/3428f419/attachment.html>