* [Buildroot] [PATCH v4 0/3] Add docker engine support
@ 2016-05-27 4:52 Christian Stewart
2016-05-27 4:52 ` [Buildroot] [PATCH v4 1/3] runc: new package Christian Stewart
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Christian Stewart @ 2016-05-27 4:52 UTC (permalink / raw)
To: buildroot
This series adds runc, docker-containerd, and docker-engine support.
Aufs is disabled in this version of the series until the pending aufs
series is merged. This version of the series can be merged without aufs
support, and aufs can simply be enabled with another patch later after
the aufs series is merged.
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.
Changes for v2:
- Fixed many minor mistakes in the original runC files
- Added hashes
- Added docker-containerd and docker-engine
Changes for v3:
- Use correct github download URLs
- Add note about arm64 fixes in docker-containerd
Changes for v4:
- Numerous fixes from Thomas's peer review (thanks!)
- Removed docker graphdriver selection from docker-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 | 184 +++++++++++++++++++++++
package/docker-containerd/Config.in | 12 ++
package/docker-containerd/docker-containerd.hash | 2 +
package/docker-containerd/docker-containerd.mk | 45 ++++++
package/docker-engine/Config.in | 36 +++++
package/docker-engine/docker-engine.hash | 2 +
package/docker-engine/docker-engine.mk | 82 ++++++++++
package/runc/Config.in | 12 ++
package/runc/runc.hash | 2 +
package/runc/runc.mk | 47 ++++++
11 files changed, 427 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
--
2.7.3
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH v4 1/3] runc: new package
2016-05-27 4:52 [Buildroot] [PATCH v4 0/3] Add docker engine support Christian Stewart
@ 2016-05-27 4:52 ` Christian Stewart
2016-05-27 5:25 ` Thomas Petazzoni
2016-05-27 4:52 ` [Buildroot] [PATCH v4 2/3] docker-containerd: " Christian Stewart
2016-05-27 4:52 ` [Buildroot] [PATCH v4 3/3] docker-engine: " Christian Stewart
2 siblings, 1 reply; 8+ messages in thread
From: Christian Stewart @ 2016-05-27 4:52 UTC (permalink / raw)
To: buildroot
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/
Signed-off-by: Christian Stewart <christian@paral.in>
---
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
---
Signed-off-by: Christian Stewart <christian@paral.in>
---
package/Config.in | 1 +
package/runc/Config.in | 12 ++++++++++++
package/runc/runc.hash | 2 ++
package/runc/runc.mk | 47 +++++++++++++++++++++++++++++++++++++++++++++++
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
diff --git a/package/Config.in b/package/Config.in
index 9d668bf..6c513ba 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -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"
diff --git a/package/runc/Config.in b/package/runc/Config.in
new file mode 100644
index 0000000..7d0c951
--- /dev/null
+++ b/package/runc/Config.in
@@ -0,0 +1,12 @@
+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_TOOLCHAIN_HAS_THREADS
diff --git a/package/runc/runc.hash b/package/runc/runc.hash
new file mode 100644
index 0000000..c109c33
--- /dev/null
+++ b/package/runc/runc.hash
@@ -0,0 +1,2 @@
+# Locally computed
+sha256 f9955daed1e73e842b2f28a258fba51f4e72a6b4b64cc3fc06415481d55ce000 runc-v0.1.1.tar.gz
diff --git a/package/runc/runc.mk b/package/runc/runc.mk
new file mode 100644
index 0000000..35e75d7
--- /dev/null
+++ b/package/runc/runc.mk
@@ -0,0 +1,47 @@
+################################################################################
+#
+# runc
+#
+################################################################################
+
+RUNC_VERSION = v0.1.1
+RUNC_VERSION_COMMIT = baf6536d6259209c3edfa2b22237af82942d3dfa
+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_COMMIT) \
+ -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))
--
2.7.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH v4 2/3] docker-containerd: new package
2016-05-27 4:52 [Buildroot] [PATCH v4 0/3] Add docker engine support Christian Stewart
2016-05-27 4:52 ` [Buildroot] [PATCH v4 1/3] runc: new package Christian Stewart
@ 2016-05-27 4:52 ` Christian Stewart
2016-05-27 5:27 ` Thomas Petazzoni
2016-05-27 4:52 ` [Buildroot] [PATCH v4 3/3] docker-engine: " Christian Stewart
2 siblings, 1 reply; 8+ messages in thread
From: Christian Stewart @ 2016-05-27 4:52 UTC (permalink / raw)
To: buildroot
docker-containerd is a daemon and API for controlling and managing runC
containers.
https://containerd.tools/
Signed-off-by: Christian Stewart <christian@paral.in>
---
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
---
Signed-off-by: Christian Stewart <christian@paral.in>
---
package/Config.in | 1 +
package/docker-containerd/0001-arm64-fixes.patch | 184 +++++++++++++++++++++++
package/docker-containerd/Config.in | 12 ++
package/docker-containerd/docker-containerd.hash | 2 +
package/docker-containerd/docker-containerd.mk | 45 ++++++
5 files changed, 244 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
diff --git a/package/Config.in b/package/Config.in
index 6c513ba..c8365f8 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -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"
diff --git a/package/docker-containerd/0001-arm64-fixes.patch b/package/docker-containerd/0001-arm64-fixes.patch
new file mode 100644
index 0000000..488822a
--- /dev/null
+++ b/package/docker-containerd/0001-arm64-fixes.patch
@@ -0,0 +1,184 @@
+From f6f54370d154b0ce5f35319d878048d7db8db89c Mon Sep 17 00:00:00 2001
+From: Lei Jitang <leijitang@huawei.com>
+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.
+
+move epoll syscall to arch specific to enable containerd run on arm64
+Rename epoll_amd64.go to epoll.go
+Signed-off-by: Lei Jitang <leijitang@huawei.com>
+
+archutils: epoll_aarch64: fix C formatting
+Signed-off-by: Aleksa Sarai <asarai@suse.de>
+
+archutils: fix build on aarch64
+Signed-off-by: Aleksa Sarai <asarai@suse.de>
+
+Use flag for aarch64 EpollCreate1
+Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
+
+Correct build flag for arm64
+Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
+---
+ 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
+
diff --git a/package/docker-containerd/Config.in b/package/docker-containerd/Config.in
new file mode 100644
index 0000000..5919347
--- /dev/null
+++ b/package/docker-containerd/Config.in
@@ -0,0 +1,12 @@
+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_TOOLCHAIN_HAS_THREADS
diff --git a/package/docker-containerd/docker-containerd.hash b/package/docker-containerd/docker-containerd.hash
new file mode 100644
index 0000000..0221b69
--- /dev/null
+++ b/package/docker-containerd/docker-containerd.hash
@@ -0,0 +1,2 @@
+# Computed locally
+sha256 f9dfeaba17064f279a7dfe89f0ef6763ee45b0a57c03aa423da2af340fba198d docker-containerd-v0.2.1.tar.gz
diff --git a/package/docker-containerd/docker-containerd.mk b/package/docker-containerd/docker-containerd.mk
new file mode 100644
index 0000000..6dd61f7
--- /dev/null
+++ b/package/docker-containerd/docker-containerd.mk
@@ -0,0 +1,45 @@
+################################################################################
+#
+# docker-containerd
+#
+################################################################################
+
+DOCKER_CONTAINERD_VERSION = v0.2.1
+DOCKER_CONTAINERD_VERSION_COMMIT = ca47f7e76a93e9b3768ed084d62318e85bd9f4b2
+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_COMMIT) \
+ -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 -s $(TARGET_DIR)/usr/bin/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))
--
2.7.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH v4 3/3] docker-engine: new package
2016-05-27 4:52 [Buildroot] [PATCH v4 0/3] Add docker engine support Christian Stewart
2016-05-27 4:52 ` [Buildroot] [PATCH v4 1/3] runc: new package Christian Stewart
2016-05-27 4:52 ` [Buildroot] [PATCH v4 2/3] docker-containerd: " Christian Stewart
@ 2016-05-27 4:52 ` Christian Stewart
2 siblings, 0 replies; 8+ messages in thread
From: Christian Stewart @ 2016-05-27 4:52 UTC (permalink / raw)
To: buildroot
Docker is a platform to build, ship, and run applications in portable
containers.
Signed-off-by: Christian Stewart <christian@paral.in>
---
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.
---
Signed-off-by: Christian Stewart <christian@paral.in>
---
package/Config.in | 1 +
package/docker-engine/Config.in | 36 ++++++++++++++
package/docker-engine/docker-engine.hash | 2 +
package/docker-engine/docker-engine.mk | 82 ++++++++++++++++++++++++++++++++
4 files changed, 121 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
diff --git a/package/Config.in b/package/Config.in
index c8365f8..b829075 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -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"
diff --git a/package/docker-engine/Config.in b/package/docker-engine/Config.in
new file mode 100644
index 0000000..20507f0
--- /dev/null
+++ b/package/docker-engine/Config.in
@@ -0,0 +1,36 @@
+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
+
+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"
+
+endif
+
+comment "docker-engine needs a toolchain w/ threads"
+ depends on !BR2_TOOLCHAIN_HAS_THREADS
diff --git a/package/docker-engine/docker-engine.hash b/package/docker-engine/docker-engine.hash
new file mode 100644
index 0000000..7b93669
--- /dev/null
+++ b/package/docker-engine/docker-engine.hash
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256 04de3750738b6f888f03520fb67db22e95e8a8e016ae901428e6c5791c9841cc docker-engine-v1.11.1.tar.gz
diff --git a/package/docker-engine/docker-engine.mk b/package/docker-engine/docker-engine.mk
new file mode 100644
index 0000000..9dd07f7
--- /dev/null
+++ b/package/docker-engine/docker-engine.mk
@@ -0,0 +1,82 @@
+################################################################################
+#
+# docker-engine
+#
+################################################################################
+
+DOCKER_ENGINE_VERSION = v1.11.1
+DOCKER_ENGINE_VERSION_COMMIT = 5604cbed50d51c4039b1abcb1cf87c4e01bce924
+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_COMMIT) \
+ -X main.Version=$(DOCKER_ENGINE_VERSION) \
+ -extldflags '-static'
+
+DOCKER_ENGINE_BUILD_TAGS = cgo
+
+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
+
+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 -s $(@D) $(DOCKER_ENGINE_GOPATH)/src/github.com/docker/docker
+ ln -s $(DOCKER_CONTAINERD_SRCDIR) $(DOCKER_ENGINE_GOPATH)/src/github.com/docker/containerd
+ mkdir -p $(DOCKER_ENGINE_GOPATH)/src/github.com/opencontainers
+ ln -s $(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))
--
2.7.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH v4 1/3] runc: new package
2016-05-27 4:52 ` [Buildroot] [PATCH v4 1/3] runc: new package Christian Stewart
@ 2016-05-27 5:25 ` Thomas Petazzoni
0 siblings, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2016-05-27 5:25 UTC (permalink / raw)
To: buildroot
Hello,
On Thu, 26 May 2016 21:52:55 -0700, Christian Stewart wrote:
> diff --git a/package/runc/Config.in b/package/runc/Config.in
> new file mode 100644
> index 0000000..7d0c951
> --- /dev/null
> +++ b/package/runc/Config.in
> @@ -0,0 +1,12 @@
> +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_TOOLCHAIN_HAS_THREADS
The comment also needs the dependency on
BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS in order to not show the comment on
architectures on which Go support is anyway not available.
> +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_COMMIT) \
As asked in my review of the previous version, what about using
RUNC_VERSION here?
Other than that, looks good to me.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH v4 2/3] docker-containerd: new package
2016-05-27 4:52 ` [Buildroot] [PATCH v4 2/3] docker-containerd: " Christian Stewart
@ 2016-05-27 5:27 ` Thomas Petazzoni
2016-05-27 7:02 ` Christian Stewart
0 siblings, 1 reply; 8+ messages in thread
From: Thomas Petazzoni @ 2016-05-27 5:27 UTC (permalink / raw)
To: buildroot
Hello,
On Thu, 26 May 2016 21:52:56 -0700, Christian Stewart wrote:
> diff --git a/package/docker-containerd/0001-arm64-fixes.patch b/package/docker-containerd/0001-arm64-fixes.patch
> new file mode 100644
> index 0000000..488822a
> --- /dev/null
> +++ b/package/docker-containerd/0001-arm64-fixes.patch
> @@ -0,0 +1,184 @@
> +From f6f54370d154b0ce5f35319d878048d7db8db89c Mon Sep 17 00:00:00 2001
> +From: Lei Jitang <leijitang@huawei.com>
> +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.
> +
> +move epoll syscall to arch specific to enable containerd run on arm64
> +Rename epoll_amd64.go to epoll.go
> +Signed-off-by: Lei Jitang <leijitang@huawei.com>
> +
> +archutils: epoll_aarch64: fix C formatting
> +Signed-off-by: Aleksa Sarai <asarai@suse.de>
> +
> +archutils: fix build on aarch64
> +Signed-off-by: Aleksa Sarai <asarai@suse.de>
> +
> +Use flag for aarch64 EpollCreate1
> +Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
> +
> +Correct build flag for arm64
> +Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Needs your Signed-off-by here.
> diff --git a/package/docker-containerd/Config.in b/package/docker-containerd/Config.in
> new file mode 100644
> index 0000000..5919347
> --- /dev/null
> +++ b/package/docker-containerd/Config.in
> @@ -0,0 +1,12 @@
> +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_TOOLCHAIN_HAS_THREADS
BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS dependency.
> +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 -s $(TARGET_DIR)/usr/bin/runc $(TARGET_DIR)/usr/bin/docker-runc
Did you do a runtime test? Because this clearly cannot work: it means
that on the target you will have a link like:
/usr/bin/docker-runc -> /home/christian/buildroot/output/target/usr/bin/runc
which obviously will not work. You instead want:
ln -s runc $(TARGET_DIR)/usr/bin/docker-runc
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH v4 2/3] docker-containerd: new package
2016-05-27 5:27 ` Thomas Petazzoni
@ 2016-05-27 7:02 ` Christian Stewart
2016-05-27 19:49 ` Thomas Petazzoni
0 siblings, 1 reply; 8+ messages in thread
From: Christian Stewart @ 2016-05-27 7:02 UTC (permalink / raw)
To: buildroot
Thomas,
On Thu, May 26, 2016 at 10:27 PM, Thomas Petazzoni <
thomas.petazzoni@free-electrons.com> wrote:
>
> Needs your Signed-off-by here.
>
Okay, will add.
> + depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
>
> BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS dependency.
>
Not sure what you're saying here
Did you do a runtime test? Because this clearly cannot work: it means
> that on the target you will have a link like:
>
> /usr/bin/docker-runc ->
> /home/christian/buildroot/output/target/usr/bin/runc
>
> which obviously will not work. You instead want:
>
> ln -s runc $(TARGET_DIR)/usr/bin/docker-runc
>
I asked about this in another email, it makes sense that that wouldn't
work, I'll fix it for the next revision.
In terms of all the versioning stuff. I'll try using the _VERSION variables
for this. As the variable specifically references a GitCommit, I included
the commits as it wants. But it's probably not too bad of a compromise to
use the version ID as the commit hash.
For the host variable, a patch series recently applied changed what that
variable contained, and in particular, the changes to CGO caused the build
to completely fail unless I included the variables from there, so I now
include it and simply add a few things on top of it to build the full build
env for the package.
Will revise on all of the series and respin late tomorrow, in case anyone
else has suggestions :)
Best,
Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160527/db44fd91/attachment.html>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH v4 2/3] docker-containerd: new package
2016-05-27 7:02 ` Christian Stewart
@ 2016-05-27 19:49 ` Thomas Petazzoni
0 siblings, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2016-05-27 19:49 UTC (permalink / raw)
To: buildroot
Hello,
On Fri, 27 May 2016 00:02:55 -0700, Christian Stewart wrote:
> > + depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
> >
>
> > BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS dependency.
> >
>
> Not sure what you're saying here
I explained it in the review of another patch from you.
When you have:
comment "<foo> needs a toolchain w/ threads"
depends on !BR2_TOOLCHAIN_HAS_THREADS
you *must* also add:
depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
so that the comment doesn't show up on architectures for which there is
no Go support.
Otherwise, imagine a user creating a configuration for say the Blackfin
architecture (which doesn't have Go support), and initially with thread
disabled. They see the comment "<foo> needs a toolchain w/ threads". So
the user goes in the Toolchain menu, and enables thread. And then, the
comment has disappeared, but the option to enable the package has not
appeared.
Hence, we want to show the comment only when
BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS=y.
> In terms of all the versioning stuff. I'll try using the _VERSION variables
> for this. As the variable specifically references a GitCommit, I included
> the commits as it wants. But it's probably not too bad of a compromise to
> use the version ID as the commit hash.
If it works, it's much better.
> For the host variable, a patch series recently applied changed what that
> variable contained, and in particular, the changes to CGO caused the build
> to completely fail unless I included the variables from there, so I now
> include it and simply add a few things on top of it to build the full build
> env for the package.
>
> Will revise on all of the series and respin late tomorrow, in case anyone
> else has suggestions :)
ACK, thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2016-05-27 19:49 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-27 4:52 [Buildroot] [PATCH v4 0/3] Add docker engine support Christian Stewart
2016-05-27 4:52 ` [Buildroot] [PATCH v4 1/3] runc: new package Christian Stewart
2016-05-27 5:25 ` Thomas Petazzoni
2016-05-27 4:52 ` [Buildroot] [PATCH v4 2/3] docker-containerd: " Christian Stewart
2016-05-27 5:27 ` Thomas Petazzoni
2016-05-27 7:02 ` Christian Stewart
2016-05-27 19:49 ` Thomas Petazzoni
2016-05-27 4:52 ` [Buildroot] [PATCH v4 3/3] docker-engine: " Christian Stewart
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox