Skip to contentSkip to conversation

docker-engine: new package

PATCH New Christian Stewart 2 participants 2 messages Jul 24, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v10 1/1 docker-engine: new package

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
Changes since v7:
- remove "-static" cgo flag which fixes build of btrfs and other additional filesystem drivers.
- build + run test with alternate filesystem drivers.
Changes since v8:
- Bump to v1.12.0-rc4
Changes since v9:
- Introduce patch to fix docker log file rotation issue
- Restructure build targets to use a foreach loop
- Remove "select" duplicates from docker-containerd
- Added BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
- Rename docker.init to S61docker
- Add -static if BR2_STATIC_LIBS is enabled.
- Remove sysv init file to be added in later patch

---
 package/Config.in                                  |   2 +
 ...-issues-with-tailing-rotated-jsonlog-file.patch | 290 +++++++++++++++++++++
 package/docker-engine/Config.in                    |  65 +++++
 package/docker-engine/docker-engine.hash           |   2 +
 package/docker-engine/docker-engine.mk             | 109 ++++++++
 5 files changed, 468 insertions(+)
 create mode 100644 package/docker-engine/0001-Fix-issues-with-tailing-rotated-jsonlog-file.patch
 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 +2 -0
index 04ca8cb..36f8b29 100644
@@ -1673,6 +1673,8 @@ 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"
 	source "package/efivar/Config.in"
package/docker-engine/0001-Fix-issues-with-tailing-rotated-jsonlog-file.patch new file +290 -0

290 lines not on this page · raw message

package/docker-engine/Config.in new file +65 -0

65 lines not on this page · raw message

package/docker-engine/docker-engine.hash new file +2 -0
new file mode 100644
index 0000000..1de09f8
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256 bc256d2a348efbf236eab991254c925fa1917dd1e29cb40586f1696f4e24852e  docker-engine-v1.12.0-rc4.tar.gz
package/docker-engine/docker-engine.mk new file +109 -0

109 lines not on this page · raw message

Signature · 1 line
2.7.3
#1 lore raw

PATCH v10 1/1 docker-engine: new package

Hello,

Thanks for this new version.

Quoted 4 lines · Christian Stewart

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

The author is normally the first Signed-off-by line.

package/Config.in menu "System tools" · line 1677

Quoted 13 lines
package/Config.in +2 -0
index 04ca8cb..36f8b29 100644
@@ -1673,6 +1673,8 @@ 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"

Still there.

Quoted 25 lines
package/Config.in +0 -0
 	source "package/dsp-tools/Config.in"
 	source "package/efibootmgr/Config.in"
 	source "package/efivar/Config.in"
package/docker-engine/0001-Fix-issues-with-tailing-rotated-jsonlog-file.patch new file +16 -0
new file mode 100644
index 0000000..e85be61
@@ -0,0 +1,290 @@
+From 8d6f2e3fe8851b581309da25fc4c32f8be675932 Mon Sep 17 00:00:00 2001
+From: Brian Goff <[email protected]>
+Date: Mon, 11 Jul 2016 16:31:42 -0400
+Subject: [PATCH] Fix issues with tailing rotated jsonlog file
+
+Fixes a race where the log reader would get events for both an actual
+rotation as we from fsnotify (`fsnotify.Rename`).
+This issue becomes extremely apparent when rotations are fast, for
+example:
+
+```
+$ docker run -d --name test --log-opt max-size=1 --log-opt max-file=2
+busybox sh -c 'while true; do echo hello; usleep 100000; done'
+```
+
+With this change the log reader for jsonlogs can handle rotations that

package/docker-engine/0001-Fix-issues-with-tailing-rotated-jsonlog-file.patch line 26

Quoted 10 lines
package/docker-engine/0001-Fix-issues-with-tailing-rotated-jsonlog-file.patch new file +10 -0
+happen as above.
+
+Instead of listening for both fs events AND rotation events
+simultaneously, potentially meaning we see 2 rotations for only a single
+rotation due to channel buffering, only listen for fs events (like
+`Rename`) and then wait to be notified about rotation by the logger.
+This makes sure that we don't see 2 rotations for 1, and that we don't
+start trying to read until the logger is actually ready for us to.
+
+Signed-off-by: Brian Goff <[email protected]>

Misses your Signed-off-by + an indication on whether this is upstream or not.

Quoted 13 lines
package/docker-engine/Config.in new file +7 -0
new file mode 100644
index 0000000..1acf121
@@ -0,0 +1,65 @@
+config BR2_PACKAGE_DOCKER_ENGINE
+	bool "docker-engine"
+	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
+	depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	help
+	  Docker is a platform to build, ship,

package/docker-engine/Config.in line 17

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

Why do you have the "depends on" of docker-containerd if you don't select it ?

Quoted 37 lines
package/docker-engine/Config.in new file +37 -0
+	select BR2_PACKAGE_SQLITE # 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

package/docker-engine/Config.in line 64

Quoted 10 lines
package/docker-engine/Config.in new file +10 -0
+	  Build the vfs filesystem driver for Docker.
+
+endif
+
+endif
+
+comment "docker-engine needs a toolchain w/ threads, wchar"
+	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
+	depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
+	depends on BR2_USE_MMU

There is no BR2_USE_MMU dependency on the top-level option to enable docker-engine, so we do have this dependency here?

package/docker-engine/Config.in line 65

Quoted 1 line
package/docker-engine/Config.in new file +1 -0
+	depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_USE_WCHAR

There is no wchar dependency on the top-level option to enable docker-engine, so why do you have a comment mentioning wchar here ?

package/docker-engine/Config.in

Quoted 8 lines
package/docker-engine/Config.in new file +8 -0
+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)" \
+	CPATH=$$CPATH:$(TARGET_DIR)/usr/include/ \
+	LIBRARY_PATH=$$LIBRARY_PATH:$(TARGET_DIR)/usr/lib/

I'm still not happy with this TARGET_DIR/usr/include and TARGET_DIR/usr/lib, and I'm wondering if they shouldn't be STAGING_DIR/usr/include and STAGING_DIR/usr/lib. Have you tried this?

package/docker-engine/Config.in

Quoted 4 lines
package/docker-engine/Config.in new file +4 -0
+define DOCKER_ENGINE_BUILD_CMDS
+	$(foreach target,$(DOCKER_ENGINE_BUILD_TARGETS), \
+		cd $(@D); $(DOCKER_ENGINE_MAKE_ENV) \
+		$(HOST_DIR)/usr/bin/go build -v \

Indent this line and the followings with one more tab.

Thanks!

Thomas

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