Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Romain Naour <romain.naour@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v6 3/5] docker-engine: new package
Date: Mon, 4 Jul 2016 23:25:44 +0200	[thread overview]
Message-ID: <e0929ee8-58d3-0e40-ae90-71f52c50517f@gmail.com> (raw)
In-Reply-To: <c0a7249a-a4a6-39e3-b804-a3db6134e3b7@gmail.com>

Le 04/07/2016 ? 22:27, Romain Naour a ?crit :
> Le 04/07/2016 ? 21:26, Christian Stewart a ?crit :
>> 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.
>> 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.
>>
>> ---
>>
>> Signed-off-by: Christian Stewart <christian@paral.in>
>> ---
>>  package/Config.in                        |   1 +
>>  package/docker-engine/Config.in          |  69 ++++++++++++++++++
>>  package/docker-engine/docker-engine.hash |   2 +
>>  package/docker-engine/docker-engine.mk   | 116 +++++++++++++++++++++++++++++++
>>  4 files changed, 188 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 01c0811..fee59a1 100644
>> --- a/package/Config.in
>> +++ b/package/Config.in
>> @@ -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"
>> diff --git a/package/docker-engine/Config.in b/package/docker-engine/Config.in
>> new file mode 100644
>> index 0000000..bbf56b1
>> --- /dev/null
>> +++ b/package/docker-engine/Config.in
>> @@ -0,0 +1,69 @@

I have some additional comments:

>> +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
missing comment about the runtime dependency

>> +	select BR2_PACKAGE_SQLITE
Why sqlite is selected ? runtime dependency ?

>> +	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
runtime dependency probably.

It seems that the busybox version of these tools are not supported by
decker-engine init scripts ?


Best regards,
Romain

>> +	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
>> diff --git a/package/docker-engine/docker-engine.hash b/package/docker-engine/docker-engine.hash
>> new file mode 100644
>> index 0000000..ac90ee6
>> --- /dev/null
>> +++ b/package/docker-engine/docker-engine.hash
>> @@ -0,0 +1,2 @@
>> +# Locally calculated
>> +sha256 3f030c4f084ed518efeb00f21f3fdfb25252dd9c153b1d42da953e59bb41c582  docker-engine-v1.12.0-rc3.tar.gz
>> diff --git a/package/docker-engine/docker-engine.mk b/package/docker-engine/docker-engine.mk
>> new file mode 100644
>> index 0000000..501afbc
>> --- /dev/null
>> +++ b/package/docker-engine/docker-engine.mk
>> @@ -0,0 +1,116 @@
>> +################################################################################
>> +#
>> +# 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-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 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
>> +	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
>> +	cd $(@D) && \
>> +		GITCOMMIT="unknown" BUILDTIME="$$(date)" VERSION="$(DOCKER_ENGINE_VERSION)" \
>> +		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_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
>> +
>> +ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DAEMON),y)
>> +define DOCKER_ENGINE_BUILD_CMDS
>> +	$(DOCKER_ENGINE_BUILD_CLIENT_CMDS)
>> +	$(DOCKER_ENGINE_BUILD_DAEMON_CMDS)
>> +endef
>> +else
>> +define DOCKER_ENGINE_BUILD_CMDS
>> +	$(DOCKER_ENGINE_BUILD_CLIENT_CMDS)
>> +endef
>> +endif
>> +
>> +define DOCKER_ENGINE_INSTALL_TARGET_CMDS
>> +	$(INSTALL) -D -m 0755 $(@D)/bin/docker $(TARGET_DIR)/usr/bin/docker
>> +	$(INSTALL) -D -m 0755 $(@D)/bin/dockerd $(TARGET_DIR)/usr/bin/dockerd
>                                     ^
> I had an error during install, dockerd needs to be installed only if it is
> selected by BR2_PACKAGE_DOCKER_ENGINE_DAEMON.
> 
> Otherwise:
>   Reviewed-by: Romain Naour <romain.naour@gmail.com>
> 
> Best regards,
> Romain
> 
> 
>> +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))
>>
> 

  reply	other threads:[~2016-07-04 21:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-04 19:26 [Buildroot] [PATCH v6 1/5] runc: new package Christian Stewart
2016-07-04 19:26 ` [Buildroot] [PATCH v6 2/5] docker-containerd: " Christian Stewart
2016-07-04 20:13   ` Romain Naour
2016-07-04 20:15     ` Christian Stewart
2016-07-04 19:26 ` [Buildroot] [PATCH v6 3/5] docker-engine: " Christian Stewart
2016-07-04 20:27   ` Romain Naour
2016-07-04 21:25     ` Romain Naour [this message]
2016-07-04 19:26 ` [Buildroot] [PATCH v6 4/5] package/docker-engine: proper sysv init file Christian Stewart
2016-07-04 19:28   ` Christian Stewart
2016-07-04 19:33     ` Thomas Petazzoni
2016-07-04 21:12   ` Romain Naour
2016-07-04 19:26 ` [Buildroot] [PATCH v6 5/5] package/docker-engine: restart - switch from ps -p to searching proc Christian Stewart
2016-07-04 20:05 ` [Buildroot] [PATCH v6 1/5] runc: new package Romain Naour
2016-07-04 20:09   ` Christian Stewart
2016-07-04 21:17     ` Romain Naour

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e0929ee8-58d3-0e40-ae90-71f52c50517f@gmail.com \
    --to=romain.naour@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox