From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v3 3/3] docker-engine: new package
Date: Thu, 26 May 2016 21:34:53 +0200 [thread overview]
Message-ID: <20160526213453.51e3ee7b@free-electrons.com> (raw)
In-Reply-To: <1464219082-3818-4-git-send-email-christian@paral.in>
Hello,
Great, docker in Buildroot! :-)
On Wed, 25 May 2016 16:31:22 -0700, Christian Stewart wrote:
> + source "package/docker-engine/Config.in"
> source "package/docker-containerd/Config.in"
Alphabetic ordering please.
> source "package/cgroupfs-mount/Config.in"
> source "package/dsp-tools/Config.in"
> diff --git a/package/docker-engine/Config.in b/package/docker-engine/Config.in
> new file mode 100644
> index 0000000..e25b16b
> --- /dev/null
> +++ b/package/docker-engine/Config.in
> @@ -0,0 +1,70 @@
> +config BR2_PACKAGE_DOCKER_ENGINE
> + bool "docker-engine"
> + depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
Thread dependency?
> + 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
You need to replicate the dependency of util-linux here, so:
depends on BR2_USE_WCHAR
depends on BR2_USE_MMU
> + help
> + Docker is a platform to build, ship,
> + and run applications as lightweight containers.
> +
> + https://github.com/docker/docker
Indentation of the help text: one tab + two spaces.
> +
> +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.
Identation: one tab + two spaces, plus wrap at 72 characters.
> +
> +config BR2_PACKAGE_DOCKER_ENGINE_EXPERIMENTAL
> + bool "build experimental features"
> +
> +if BR2_PACKAGE_DOCKER_ENGINE_DAEMON
> +
> +config BR2_PACKAGE_DOCKER_ENGINE_DRIVER_AUFS
> + bool "aufs filesystem driver"
> + depends on BR2_USE_WCHAR # aufs-util
> + depends on BR2_USE_MMU # aufs-util
> + depends on BR2_TOOLCHAIN_HAS_THREADS # aufs-util
> + select BR2_PACKAGE_AUFS_UTIL
> + help
> + Build the aufs filesystem driver for Docker.
Didn't you say in your cover letter that the AUFS support was not
integrated? The symbol BR2_PACKAGE_AUFS_UTIL does not exist in
Buildroot.
> +
> +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.
Indentation.
> +
> +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.
Ditto.
> +
> +config BR2_PACKAGE_DOCKER_ENGINE_DRIVER_VFS
> + bool "vfs filesystem driver"
Is the driver called vfs or gvfs ?
> + 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.
Ditto.
> +
> +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..0dc6b46
> --- /dev/null
> +++ b/package/docker-engine/docker-engine.mk
> @@ -0,0 +1,110 @@
> +################################################################################
> +#
> +# docker-engine
> +#
> +################################################################################
> +
> +DOCKER_ENGINE_VERSION = v1.11.1
> +DOCKER_ENGINE_VERSION_COMMIT = 5604cbed50d51c4039b1abcb1cf87c4e01bce924
Same question :)
> +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_MAKE_ENV = \
> + GOBIN="$(@D)/bin" \
> + GOPATH="$(@D)/vendor" \
> + GOARCH=$(GO_GOARCH) \
> + CGO_ENABLED=1 \
> + CGO_NO_EMULATION=1
HOST_GO_TARGET_ENV usage
> +
> +DOCKER_ENGINE_GLDFLAGS = \
> + -X main.GitCommit=$(DOCKER_ENGINE_VERSION_COMMIT) \
> + -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
So docker links with some btrfs library?
> +else
> +DOCKER_ENGINE_BUILD_TAGS += exclude_graphdriver_btrfs
> +endif
> +
> +ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DRIVER_AUFS),y)
> +DOCKER_ENGINE_DEPENDENCIES += aufs-util
> +else
> +DOCKER_ENGINE_BUILD_TAGS += exclude_graphdriver_aufs
> +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
> + # Put sources at prescribed GOPATH location.
> + export $(DOCKER_ENGINE_MAKE_ENV) && \
> + $(SED) '/^clean$$/d' $(@D)/hack/vendor.sh && \
> + cd $(@D) && bash ./hack/vendor.sh && \
> + mkdir -p $(@D)/vendor/src/github.com/docker && \
> + ln -s $(@D) $(@D)/vendor/src/github.com/docker/docker && \
> + ln -s $(DOCKER_CONTAINERD_SRCDIR) $(@D)/vendor/src/github.com/docker/containerd && \
> + mkdir -p $$GOPATH/src/github.com/opencontainers && \
> + ln -s $(RUNC_SRCDIR) $(@D)/vendor/src/github.com/opencontainers/runc
Same comments as with other packages.
> +endef
> +
> +define DOCKER_ENGINE_BUILD_CMDS
> + cd $(@D) && export $(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
Ditto.
> +
> +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
Is the sysvinit-redhat script actually working in Buildroot with a
Busybox shell?
> + mkdir -p $(TARGET_DIR)/etc/sysconfig
Not needed $(INSTALL) -D does it for you.
> + $(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))
Thanks a lot!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
prev parent reply other threads:[~2016-05-26 19:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-25 23:31 [Buildroot] [PATCH v3 0/3] Add docker engine support Christian Stewart
2016-05-25 23:31 ` [Buildroot] [PATCH v3 1/3] runc: new package Christian Stewart
2016-05-26 19:12 ` Thomas Petazzoni
2016-05-26 19:51 ` Geoff Levand
2016-05-26 20:01 ` Thomas Petazzoni
2016-05-26 20:21 ` Christian Stewart
2016-05-27 5:23 ` Thomas Petazzoni
2016-05-25 23:31 ` [Buildroot] [PATCH v3 2/3] docker-containerd: " Christian Stewart
2016-05-26 19:29 ` Thomas Petazzoni
2016-05-26 23:10 ` Christian Stewart
2016-05-25 23:31 ` [Buildroot] [PATCH v3 3/3] docker-engine: " Christian Stewart
2016-05-26 19:34 ` Thomas Petazzoni [this message]
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=20160526213453.51e3ee7b@free-electrons.com \
--to=thomas.petazzoni@free-electrons.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.