Skip to contentSkip to conversation

runc: new package

PATCH New Christian Stewart 3 participants 8 messages Jul 4, 2016 – Jul 5, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v7 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
Changes since v5:
- bump to v1.0.0-rc1

---

---
 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 2c4c196..078436e 100644
@@ -1665,6 +1665,7 @@ menu "System tools"
 	source "package/pwgen/Config.in"
 	source "package/quota/Config.in"
 	source "package/rsyslog/Config.in"
+	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..e6ec483
@@ -0,0 +1,2 @@
+# Locally computed
+sha256 77f9d4df1657fecc939be0261fcccccd34d5b22c02b8a49abad23fac33b4059a  runc-v1.0.0-rc1.tar.gz
package/runc/runc.mk new file +46 -0

46 lines not on this page · raw message

Signature · 1 line
2.7.3
#1 lore raw

PATCH v7 2/3 docker-containerd: new package

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
Changes since v5:
- containerd-shim aliased to docker-containerd-shim
- bumped to 1b3a8154 (commit pin required)
- patches removed (included in bump)
Changes since v6:
- added note about runtime dependency
- add required dependencies on util-linux, mmu, wchar

---

---
 package/Config.in                                |  1 +
 package/docker-containerd/Config.in              | 20 +++++++++++
 package/docker-containerd/docker-containerd.hash |  2 ++
 package/docker-containerd/docker-containerd.mk   | 45 ++++++++++++++++++++++++
 4 files changed, 68 insertions(+)
 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 078436e..01c0811 100644
@@ -1636,6 +1636,7 @@ menu "System tools"
 	source "package/cpuload/Config.in"
 	source "package/dcron/Config.in"
 	source "package/debianutils/Config.in"
+	source "package/docker-containerd/Config.in"
 	source "package/cgroupfs-mount/Config.in"
 	source "package/dsp-tools/Config.in"
 	source "package/efibootmgr/Config.in"
package/docker-containerd/Config.in new file +20 -0
new file mode 100644
index 0000000..b2f2983
@@ -0,0 +1,20 @@
+config BR2_PACKAGE_DOCKER_CONTAINERD
+	bool "docker-containerd"
+	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_RUNC # runc: runtime dependency
+	select BR2_PACKAGE_UTIL_LINUX # util-linux: runtime dependency
+	select BR2_PACKAGE_UTIL_LINUX_BINARIES # util-linux: runtime dependency
+	select BR2_PACKAGE_UTIL_LINUX_PIVOT_ROOT # util-linux: runtime dependency
+	select BR2_PACKAGE_UTIL_LINUX_MOUNTPOINT # util-linux: runtime dependency
+	select BR2_PACKAGE_UTIL_LINUX_MOUNT # util-linux: runtime dependency
+	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..a4a427d
@@ -0,0 +1,2 @@
+# Computed locally
+sha256 bdfa54c94f3de901a7983dc0bc924dd2268e9a5f5fe920d27bfdafad60958522  docker-containerd-1b3a81545ca79456086dc2aa424357be98b962ee.tar.gz
package/docker-containerd/docker-containerd.mk new file +45 -0

45 lines not on this page · raw message

Signature · 1 line
2.7.3
#2 lore raw

PATCH v7 2/3 docker-containerd: new package

Hi Christian,

Le 05/07/2016 ? 00:30, Christian Stewart a ?crit :

Quoted 6 lines

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

https://containerd.tools/

Best regards,
Romain

Quoted 134 lines

---

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
Changes since v5:
- containerd-shim aliased to docker-containerd-shim
- bumped to 1b3a8154 (commit pin required)
- patches removed (included in bump)
Changes since v6:
- added note about runtime dependency
- add required dependencies on util-linux, mmu, wchar

---

---
 package/Config.in                                |  1 +
 package/docker-containerd/Config.in              | 20 +++++++++++
 package/docker-containerd/docker-containerd.hash |  2 ++
 package/docker-containerd/docker-containerd.mk   | 45 ++++++++++++++++++++++++
 4 files changed, 68 insertions(+)
 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 078436e..01c0811 100644
@@ -1636,6 +1636,7 @@ menu "System tools"
 	source "package/cpuload/Config.in"
 	source "package/dcron/Config.in"
 	source "package/debianutils/Config.in"
+	source "package/docker-containerd/Config.in"
 	source "package/cgroupfs-mount/Config.in"
 	source "package/dsp-tools/Config.in"
 	source "package/efibootmgr/Config.in"
package/docker-containerd/Config.in new file +20 -0
new file mode 100644
index 0000000..b2f2983
@@ -0,0 +1,20 @@
+config BR2_PACKAGE_DOCKER_CONTAINERD
+	bool "docker-containerd"
+	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_RUNC # runc: runtime dependency
+	select BR2_PACKAGE_UTIL_LINUX # util-linux: runtime dependency
+	select BR2_PACKAGE_UTIL_LINUX_BINARIES # util-linux: runtime dependency
+	select BR2_PACKAGE_UTIL_LINUX_PIVOT_ROOT # util-linux: runtime dependency
+	select BR2_PACKAGE_UTIL_LINUX_MOUNTPOINT # util-linux: runtime dependency
+	select BR2_PACKAGE_UTIL_LINUX_MOUNT # util-linux: runtime dependency
+	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..a4a427d
@@ -0,0 +1,2 @@
+# Computed locally
+sha256 bdfa54c94f3de901a7983dc0bc924dd2268e9a5f5fe920d27bfdafad60958522  docker-containerd-1b3a81545ca79456086dc2aa424357be98b962ee.tar.gz
package/docker-containerd/docker-containerd.mk new file +45 -0
new file mode 100644
index 0000000..f0000e6
@@ -0,0 +1,45 @@
+################################################################################
+#
+# docker-containerd
+#
+################################################################################
+
+DOCKER_CONTAINERD_VERSION = 1b3a81545ca79456086dc2aa424357be98b962ee
+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
+	ln -fs containerd-shim $(TARGET_DIR)/usr/bin/docker-containerd-shim
+endef
+
+$(eval $(generic-package))
#3 lore raw

PATCH v7 2/3 docker-containerd: new package

In reply to Christian Stewart

Hello,

I applied your patch, after doing some changes. See below.

package/docker-containerd/Config.in line 7

Quoted 13 lines · Christian Stewart
package/docker-containerd/Config.in new file +7 -0
new file mode 100644
index 0000000..b2f2983
@@ -0,0 +1,20 @@
+config BR2_PACKAGE_DOCKER_CONTAINERD
+	bool "docker-containerd"
+	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_RUNC # runc: runtime dependency

No need to indicate "runc: runtime dependency", "runtime dependency" is enough.

package/docker-containerd/Config.in line 8

Quoted 1 line
package/docker-containerd/Config.in new file +1 -0
+	select BR2_PACKAGE_UTIL_LINUX # util-linux: runtime dependency

Ditto.

package/docker-containerd/Config.in line 12

Quoted 4 lines
package/docker-containerd/Config.in new file +4 -0
+	select BR2_PACKAGE_UTIL_LINUX_BINARIES # util-linux: runtime dependency
+	select BR2_PACKAGE_UTIL_LINUX_PIVOT_ROOT # util-linux: runtime dependency
+	select BR2_PACKAGE_UTIL_LINUX_MOUNTPOINT # util-linux: runtime dependency
+	select BR2_PACKAGE_UTIL_LINUX_MOUNT # util-linux: runtime dependency

For those selects, the "runtime dependency" comment is useless, so I removed it.

package/docker-containerd/Config.in line 20

Quoted 8 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

You forgot the wchar dependency here, and also the BR2_USE_MMU dependency.

package/docker-containerd/Config.in

Quoted 4 lines
package/docker-containerd/Config.in new file +4 -0
+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

These lines were a bit too long, and also repetitive. So I refactored this with a foreach loop.

Thanks,

Thomas

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

PATCH v7 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.
- bump to v1.12.0-rc3
- remove hack/vendor.sh call, it is unnecessary, dependencies are pre-vendored into the source tree.
Changes since v6:
- remove build-time dependency on docker-containerd and runc
- install dockerd only if daemon is enabled
- move all daemon dependencies into daemon selection
- only install sysv, users, etc if daemon is enabled
- add a proper sysv init file
- remove DOCKER_OPTS in init file
- remove test for $BASH as bash is never used for init
- use hash for documentation link in sysv init file
- remove unnecessary path change in sysv init file
- remove exit on error line in sysv init file
- remove init info comment from sysv init file

---
 package/Config.in                        |   1 +
 package/docker-engine/Config.in          |  69 +++++++++++++++++
 package/docker-engine/docker-engine.hash |   2 +
 package/docker-engine/docker-engine.mk   | 128 +++++++++++++++++++++++++++++++
 package/docker-engine/docker.init        |  89 +++++++++++++++++++++
 5 files changed, 289 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
 create mode 100644 package/docker-engine/docker.init
package/Config.in +1 -0
index 01c0811..fee59a1 100644
@@ -1637,6 +1637,7 @@ menu "System tools"
 	source "package/dcron/Config.in"
 	source "package/debianutils/Config.in"
 	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/efibootmgr/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..ac90ee6
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256 3f030c4f084ed518efeb00f21f3fdfb25252dd9c153b1d42da953e59bb41c582  docker-engine-v1.12.0-rc3.tar.gz
package/docker-engine/docker-engine.mk new file +128 -0

128 lines not on this page · raw message

package/docker-engine/docker.init new file +89 -0

89 lines not on this page · raw message

Signature · 1 line
2.7.3
#5 lore raw

PATCH v7 3/3 docker-engine: new package

Le 05/07/2016 ? 00:30, Christian Stewart a ?crit :

Quoted 74 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.
- bump to v1.12.0-rc3
- remove hack/vendor.sh call, it is unnecessary, dependencies are pre-vendored into the source tree.
Changes since v6:
- remove build-time dependency on docker-containerd and runc
- install dockerd only if daemon is enabled
- move all daemon dependencies into daemon selection
- only install sysv, users, etc if daemon is enabled
- add a proper sysv init file
- remove DOCKER_OPTS in init file
- remove test for $BASH as bash is never used for init
- use hash for documentation link in sysv init file
- remove unnecessary path change in sysv init file
- remove exit on error line in sysv init file
- remove init info comment from sysv init file

---
 package/Config.in                        |   1 +
 package/docker-engine/Config.in          |  69 +++++++++++++++++
 package/docker-engine/docker-engine.hash |   2 +
 package/docker-engine/docker-engine.mk   | 128 +++++++++++++++++++++++++++++++
 package/docker-engine/docker.init        |  89 +++++++++++++++++++++
 5 files changed, 289 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
 create mode 100644 package/docker-engine/docker.init
package/Config.in +1 -0
index 01c0811..fee59a1 100644
@@ -1637,6 +1637,7 @@ menu "System tools"
 	source "package/dcron/Config.in"
 	source "package/debianutils/Config.in"
 	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/efibootmgr/Config.in"
package/docker-engine/Config.in new file +3 -0
new file mode 100644
index 0000000..fa40678
@@ -0,0 +1,69 @@
+config BR2_PACKAGE_DOCKER_ENGINE
+	bool "docker-engine"
+	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS

package/docker-engine/Config.in line 13

Quoted 10 lines
package/docker-engine/Config.in new file +10 -0
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	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

Move this comment at the end of Config.in in order to indent the following docker-engine options in menuconfig.

[*] docker-engine
[*] docker daemon
[*] build experimental features
...

Due to this indentation issue, I haven't enabled the btrfs, lvm and vfs during my previous test.
Now I enabled these options and I get the following error:

vendor/src/github.com/docker/docker/daemon/graphdriver/btrfs/btrfs.go:8:25:
fatal error: btrfs/ioctl.h: No such file or directory

Can you take a look ?

If you don't want to delay docker-engine merge, you can remove the btrfs and add it in a followup patch ?

Quoted 133 lines
package/docker-engine/Config.in new file +56 -0
+
+if BR2_PACKAGE_DOCKER_ENGINE
+
+config BR2_PACKAGE_DOCKER_ENGINE_DAEMON
+	bool "docker daemon"
+	depends on BR2_USE_MMU # docker-containerd
+	depends on BR2_USE_WCHAR # docker-containerd
+	select BR2_PACKAGE_DOCKER_CONTAINERD # docker-containerd: runtime dependency
+	select BR2_PACKAGE_RUNC # docker-containerd: runtime dependency
+	select BR2_PACKAGE_UTIL_LINUX # docker-containerd: runtime dependency
+	select BR2_PACKAGE_UTIL_LINUX_BINARIES # docker-containerd: runtime dependency
+	select BR2_PACKAGE_UTIL_LINUX_PIVOT_ROOT # docker-containerd: runtime dependency
+	select BR2_PACKAGE_UTIL_LINUX_MOUNTPOINT # docker-containerd: runtime dependency
+	select BR2_PACKAGE_UTIL_LINUX_MOUNT # docker-containerd: runtime dependency
+	select BR2_PACKAGE_SQLITE # docker-engine: runtime dependency
+	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..ac90ee6
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256 3f030c4f084ed518efeb00f21f3fdfb25252dd9c153b1d42da953e59bb41c582  docker-engine-v1.12.0-rc3.tar.gz
package/docker-engine/docker-engine.mk new file +63 -0
new file mode 100644
index 0000000..5516423
@@ -0,0 +1,128 @@
+################################################################################
+#
+# docker-engine
+#
+################################################################################
+
+DOCKER_ENGINE_VERSION = v1.12.0-rc3
+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_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 autogen
+
+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
+
+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
+	ln -fs $(@D) $(DOCKER_ENGINE_GOPATH)/src/github.com/docker/docker
+	cd $(@D) && \
+		GITCOMMIT="unknown" BUILDTIME="$$(date)" VERSION="$(DOCKER_ENGINE_VERSION)" \

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

Quoted 10 lines
package/docker-engine/docker-engine.mk new file +10 -0
+		bash ./hack/make/.go-autogen
+endef
+
+define DOCKER_ENGINE_BUILD_CLIENT_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)" ./cmd/docker
+endef
+
+define DOCKER_ENGINE_INSTALL_TARGET_CLIENT_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/bin/docker $(TARGET_DIR)/usr/bin/docker
+endef

There is two DOCKER_ENGINE_BUILD_CMDS depending on docker engine daemon is enabled or not, I recommend you to move *_DAEMON_CMDS bellow BR2_PACKAGE_DOCKER_ENGINE_DAEMON=y

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

Quoted 11 lines
package/docker-engine/docker-engine.mk new file +11 -0
+
+define DOCKER_ENGINE_BUILD_DAEMON_CMDS
+	cd $(@D); $(DOCKER_ENGINE_MAKE_ENV) $(HOST_DIR)/usr/bin/go build -v -o $(@D)/bin/dockerd -tags "$(DOCKER_ENGINE_BUILD_TAGS)" -ldflags "$(DOCKER_ENGINE_GLDFLAGS)" ./cmd/dockerd
+endef
+
+define DOCKER_ENGINE_INSTALL_TARGET_DAEMON_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/bin/dockerd $(TARGET_DIR)/usr/bin/dockerd
+endef
+
+ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DAEMON),y)
+

move DOCKER_ENGINE_BUILD_DAEMON_CMDS and
DOCKER_ENGINE_INSTALL_TARGET_DAEMON_CMDS here

move DOCKER_ENGINE_BUILD_CMDS and DOCKER_ENGINE_INSTALL_TARGET_CMDS outside of BR2_PACKAGE_DOCKER_ENGINE_DAEMON)=y

Quoted 25 lines
package/docker-engine/docker-engine.mk new file +24 -0
+define DOCKER_ENGINE_BUILD_CMDS
+	$(DOCKER_ENGINE_BUILD_CLIENT_CMDS)
+	$(DOCKER_ENGINE_BUILD_DAEMON_CMDS)
+endef
+
+define DOCKER_ENGINE_INSTALL_TARGET_CMDS
+	$(DOCKER_ENGINE_INSTALL_TARGET_CLIENT_CMDS)
+	$(DOCKER_ENGINE_INSTALL_TARGET_DAEMON_CMDS)
+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 package/docker-engine/docker.init \
+		$(TARGET_DIR)/etc/init.d/S61docker
+	$(INSTALL) -D -m 644 $(@D)/contrib/init/sysvinit-debian/docker.default \

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

Quoted 10 lines
package/docker-engine/docker-engine.mk new file +10 -0
+		$(TARGET_DIR)/etc/default/docker
+endef
+
+define DOCKER_ENGINE_USERS
+	- - docker -1 * - - - Docker Application Container Framework
+endef
+
+else
+
+define DOCKER_ENGINE_BUILD_CMDS

remove this one

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

Quoted 4 lines
package/docker-engine/docker-engine.mk new file +4 -0
+	$(DOCKER_ENGINE_BUILD_CLIENT_CMDS)
+endef
+
+define DOCKER_ENGINE_INSTALL_TARGET_CMDS

remove this one

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

Quoted 3 lines
package/docker-engine/docker-engine.mk new file +3 -0
+	$(DOCKER_ENGINE_INSTALL_TARGET_CLIENT_CMDS)
+endef
+

actually remove the else case :)

Quoted 1 line

+endif

move DOCKER_ENGINE_BUILD_CMDS and DOCKER_ENGINE_INSTALL_TARGET_CMDS here.

DOCKER_ENGINE_BUILD_DAEMON_CMDS and DOCKER_ENGINE_INSTALL_TARGET_DAEMON_CMDS will be defined only if BR2_PACKAGE_DOCKER_ENGINE_DAEMON is selected

Best regards,
Romain

Quoted 98 lines
package/docker-engine/docker-engine.mk new file +2 -0
+
+$(eval $(generic-package))
package/docker-engine/docker.init new file +89 -0
new file mode 100644
index 0000000..99c38b7
@@ -0,0 +1,89 @@
+#!/bin/sh
+
+BASE=docker
+
+# modify these in /etc/default/$BASE (/etc/default/docker)
+DOCKERD=/usr/bin/dockerd
+# This is the pid file managed by docker itself
+DOCKER_PIDFILE=/var/run/$BASE.pid
+# This is the pid file created/managed by start-stop-daemon
+DOCKER_SSD_PIDFILE=/var/run/$BASE-ssd.pid
+DOCKER_LOGFILE=/var/log/$BASE.log
+DOCKER_DESC="Docker"
+
+if [ -f /etc/default/$BASE ]; then
+       . /etc/default/$BASE
+fi
+
+# Check docker is present
+if [ ! -x $DOCKERD ]; then
+       echo "$DOCKERD not present or not executable"
+       exit 1
+fi
+
+cgroupfs_mount() {
+       # see also https://github.com/tianon/cgroupfs-mount/blob/951c38ee8d802330454bdede20d85ec1c0f8d312/cgroupfs-mount
+       if grep -v '^#' /etc/fstab | grep -q cgroup \
+               || [ ! -e /proc/cgroups ] \
+               || [ ! -d /sys/fs/cgroup ]; then
+               return
+       fi
+       if ! mountpoint -q /sys/fs/cgroup; then
+               mount -t tmpfs -o uid=0,gid=0,mode=0755 cgroup /sys/fs/cgroup
+       fi
+       (
+               cd /sys/fs/cgroup
+               for sys in $(awk '!/^#/ { if ($4 == 1) print $1 }' /proc/cgroups); do
+                       mkdir -p $sys
+                       if ! mountpoint -q $sys; then
+                               if ! mount -n -t cgroup -o $sys cgroup $sys; then
+                                       rmdir $sys || true
+                               fi
+                       fi
+               done
+       )
+}
+
+case "$1" in
+       start)
+               cgroupfs_mount
+
+               ulimit -n 1048576
+               ulimit -p 1048576
+
+               echo "Starting $DOCKER_DESC: $BASE"
+               start-stop-daemon --start --background \
+                       --exec "$DOCKERD" \
+                       --pidfile "$DOCKER_SSD_PIDFILE" \
+                       --make-pidfile \
+                       -- \
+                               -p "$DOCKER_PIDFILE" \
+                               $DOCKER_OPTS \
+                                       >> "$DOCKER_LOGFILE" 2>&1
+               echo $?
+               ;;
+
+       stop)
+               echo "Stopping $DOCKER_DESC: $BASE"
+               start-stop-daemon --stop --pidfile "$DOCKER_SSD_PIDFILE" --retry 10
+               echo $?
+               ;;
+
+       restart)
+               docker_pid=`cat "$DOCKER_SSD_PIDFILE" 2>/dev/null`
+               [ -n "$docker_pid" ] \
+                       && [ -d /proc/$docker_pid ] \
+                       && $0 stop \
+                       && sleep 1
+               $0 start
+               ;;
+
+       force-reload)
+               $0 restart
+               ;;
+
+       *)
+               echo "Usage: service docker {start|stop|restart}"
+               exit 1
+               ;;
+esac
#6 lore raw

PATCH v7 1/3 runc: new package

In reply to Christian Stewart

Hi Christian,

Le 05/07/2016 ? 00:30, 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/

If you get a reviewed/acked/tested tag on a patch in a series and if you do not change it, you can keep the tag when you respin the series.

Best regards,
Romain

Quoted 119 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
Changes since v5:
- bump to v1.0.0-rc1

---

---
 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 2c4c196..078436e 100644
@@ -1665,6 +1665,7 @@ menu "System tools"
 	source "package/pwgen/Config.in"
 	source "package/quota/Config.in"
 	source "package/rsyslog/Config.in"
+	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..e6ec483
@@ -0,0 +1,2 @@
+# Locally computed
+sha256 77f9d4df1657fecc939be0261fcccccd34d5b22c02b8a49abad23fac33b4059a  runc-v1.0.0-rc1.tar.gz
package/runc/runc.mk new file +46 -0
new file mode 100644
index 0000000..3f352bd
@@ -0,0 +1,46 @@
+################################################################################
+#
+# runc
+#
+################################################################################
+
+RUNC_VERSION = v1.0.0-rc1
+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))
#7 lore raw

PATCH v7 1/3 runc: new package

In reply to Christian Stewart

Hello,

Quoted 11 lines · Christian Stewart

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/

---

Applied to master, thanks.

Thomas

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