From patchwork Sat May 28 22:46:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Stewart X-Patchwork-Id: 627457 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rHJ0T3r58z9t3w for ; Sun, 29 May 2016 08:46:49 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=paral-in.20150623.gappssmtp.com header.i=@paral-in.20150623.gappssmtp.com header.b=nk2CCAyQ; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id E5DEA9287E; Sat, 28 May 2016 22:46:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nz36F3TnhsAJ; Sat, 28 May 2016 22:46:40 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 6E6F792858; Sat, 28 May 2016 22:46:39 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 777911C0EAF for ; Sat, 28 May 2016 22:46:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 72105314D8 for ; Sat, 28 May 2016 22:46:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Deu4Khugxr1k for ; Sat, 28 May 2016 22:46:34 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pf0-f176.google.com (mail-pf0-f176.google.com [209.85.192.176]) by silver.osuosl.org (Postfix) with ESMTPS id 42A97313EB for ; Sat, 28 May 2016 22:46:34 +0000 (UTC) Received: by mail-pf0-f176.google.com with SMTP id b124so52582536pfb.0 for ; Sat, 28 May 2016 15:46:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paral-in.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XzlGtTg8N5566bhqPoXaFW7wy4+cq1EI4hadGYBysg0=; b=nk2CCAyQGjoM+QAn4xqkRoIUHG3AKvfq89mB/oTviP8UriZrQx4Cxhrf+NVbyqUyFM mZEaxFg81/Fnn/33Wz7Wee/SSLYdhZ1VUZjZq5BFmlryeSZu4gaoUN+LVpSCtnikCtni XQbTwSYnPEgSiWT5MjYVx3NTx35/A+GQfhBvvZHtsdnb1o2Psy/KXpKWTRBAXkN7qkhA P78+dbP5D8MmQaxERK7aw2EMEuHB3X75BSm/SmAzxEmu4jOiVUhRNEpqzmG56MNrWq5E V3I0QdIE6vts4DtwGVTDwKcapD4LdV/1rneJ4oJ599Spsy9NEHXr3GDAfr97y45+4BVj BkMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=XzlGtTg8N5566bhqPoXaFW7wy4+cq1EI4hadGYBysg0=; b=Ew9buNspKNHyRI1QKh1DJV/nC03e5G9Gth1lJci2TaUobN/MHbPvAoT5KD5/35LX0q QIYNjS3QgouyonvD/+mmryCIAgfOKYZm4ItWvt4bNMvjxopBQM+KjeKOg6NmF5dEDcim 6i18i4U/Y8Z/i6uXFxXPT/Q4TU/cxOkdiIOBDEeTBklXhpYG65n82XAjL1Xwb9B2pNPw dnWD7ObRl98A2ZAD88RhYNiaK8FBlKesGVZIbJQZtq6hrey/thkGyYI2CGWj10ZQgpxR s5sx29LlAiNCz78dgZQO8K7NBxEL4npf7tQkRHlMC7muBbyc+mEt/MuLLURnKIBREWIX AQyA== X-Gm-Message-State: ALyK8tIt/+7s1jJ133YkXJ7EBX8mwTarZy73l2GfLS2cRtJxYaBfwYvMq4gkmr4orY7PsQ== X-Received: by 10.98.26.210 with SMTP id a201mr15777777pfa.46.1464475593795; Sat, 28 May 2016 15:46:33 -0700 (PDT) Received: from localhost.localdomain (cpe-108-185-112-114.socal.res.rr.com. [108.185.112.114]) by smtp.gmail.com with ESMTPSA id qm10sm37281214pac.33.2016.05.28.15.46.31 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sat, 28 May 2016 15:46:32 -0700 (PDT) From: Christian Stewart To: buildroot@buildroot.org Date: Sat, 28 May 2016 15:46:18 -0700 Message-Id: <1464475578-22239-4-git-send-email-christian@paral.in> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1464475578-22239-1-git-send-email-christian@paral.in> References: <1464475578-22239-1-git-send-email-christian@paral.in> Cc: geoff@infradead.org, thomas.petazzoni@free-electrons.com, Christian Stewart Subject: [Buildroot] [PATCH v6 3/3] docker-engine: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Docker is a platform to build, ship, and run applications in portable containers. Signed-off-by: Christian Stewart --- 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 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..bbf56b1 --- /dev/null +++ b/package/docker-engine/Config.in @@ -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 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..b7407b2 --- /dev/null +++ b/package/docker-engine/docker-engine.mk @@ -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 + +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 + 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))