package/docker-engine: split docker-{cli, engine}, bump to v18.09.0
authorChristian Stewart <christian@paral.in>
Tue, 27 Nov 2018 08:56:55 +0000 (00:56 -0800)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Mon, 3 Dec 2018 20:11:03 +0000 (21:11 +0100)
Docker upstream has split the Docker daemon and CLI into separate
codebases:

 - github.com/docker/engine: daemon, "dockerd" binary
 - github.com/docker/cli: "docker" command line interface

This commit splits the docker-engine package into docker-engine and
docker-cli.  Conveniently, the Docker project has begun maintaining
two separate release-tagged repositories for the CLI and daemon as of
v18.06-ce-rc1. Previous versions were tagged in a common "docker-ce"
repository which makes compilation awkward for Buildroot, especially
due to some limitations in the new Go package infrastructure.

Docker repositories "engine" and "cli" recently started tagging
releases. Select the latest stable release, v18.09.0.

The CLI is no longer automatically included with the engine. Users
will need to select BR2_PACKAGE_DOCKER_CLI to produce a both docker
and dockerd target binaries.

Docker CLI can be statically compiled. This enables usage of the
system docker client binary to access the parent daemon API from
within containers, where shared libraries are not available.

While at it, drop the useless host-go dependency from docker-engine,
since it's already added by the golang-package infrastructure.

Signed-off-by: Christian Stewart <christian@paral.in>
[Thomas: drop the host-go dependency from both docker-cli and
docker-engine]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Config.in.legacy
package/Config.in
package/docker-cli/Config.in [new file with mode: 0644]
package/docker-cli/docker-cli.hash [new file with mode: 0644]
package/docker-cli/docker-cli.mk [new file with mode: 0644]
package/docker-engine/Config.in
package/docker-engine/docker-engine.hash
package/docker-engine/docker-engine.mk

index a5e0c9fe4fe00ff1a2dab525d755bfa3fe475d9c..02321c88ae121064c6e9ea3182f46090b8e1a4ad 100644 (file)
@@ -241,6 +241,15 @@ config BR2_PACKAGE_LIBNFTNL_XML
 ###############################################################################
 comment "Legacy options removed in 2018.08"
 
+config BR2_PACKAGE_DOCKER_ENGINE_STATIC_CLIENT
+       bool "docker-engine static client option renamed"
+       select BR2_LEGACY
+       select BR2_PACKAGE_DOCKER_CLI_STATIC
+       help
+         BR2_PACKAGE_DOCKER_ENGINE_STATIC_CLIENT has been renamed to
+         BR2_PACKAGE_DOCKER_CLI_STATIC, following the package split of
+         docker-engine and docker-cli.
+
 config BR2_PACKAGE_XSERVER_XORG_SERVER_V_1_19
        bool "Modular X.org server was updated to version 1.20.0"
        select BR2_LEGACY
index 0339ec77d787fa7eb07295cc76d0cee59f06b156..912d31d6b8278de51eeb104ca7fd265fcf849e2d 100644 (file)
@@ -2118,6 +2118,7 @@ menu "System tools"
        source "package/dcron/Config.in"
        source "package/ddrescue/Config.in"
        source "package/debianutils/Config.in"
+       source "package/docker-cli/Config.in"
        source "package/docker-compose/Config.in"
        source "package/docker-containerd/Config.in"
        source "package/docker-engine/Config.in"
diff --git a/package/docker-cli/Config.in b/package/docker-cli/Config.in
new file mode 100644 (file)
index 0000000..82c35c4
--- /dev/null
@@ -0,0 +1,25 @@
+config BR2_PACKAGE_DOCKER_CLI
+       bool "docker-cli"
+       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,
+         and run applications as lightweight containers.
+
+         https://github.com/docker/cli
+
+if BR2_PACKAGE_DOCKER_CLI
+
+config BR2_PACKAGE_DOCKER_CLI_STATIC
+       bool "build static client"
+       depends on !BR2_STATIC_LIBS
+       help
+         Build a static docker client.
+
+endif
+
+comment "docker-cli needs a toolchain w/ threads"
+       depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
+       depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
+       depends on !BR2_TOOLCHAIN_HAS_THREADS
diff --git a/package/docker-cli/docker-cli.hash b/package/docker-cli/docker-cli.hash
new file mode 100644 (file)
index 0000000..03322a4
--- /dev/null
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256 3e578406dead2fc72c4b52f77db39dc779fa8b460352116c06f1ae29219bd8c2  docker-cli-v18.09.0.tar.gz
+sha256 2d81ea060825006fc8f3fe28aa5dc0ffeb80faf325b612c955229157b8c10dc0  LICENSE
diff --git a/package/docker-cli/docker-cli.mk b/package/docker-cli/docker-cli.mk
new file mode 100644 (file)
index 0000000..bb8ce41
--- /dev/null
@@ -0,0 +1,31 @@
+###############################################################################
+#
+# docker-cli
+#
+################################################################################
+
+DOCKER_CLI_VERSION = v18.09.0
+DOCKER_CLI_SITE = $(call github,docker,cli,$(DOCKER_CLI_VERSION))
+DOCKER_CLI_WORKSPACE = gopath
+
+DOCKER_CLI_LICENSE = Apache-2.0
+DOCKER_CLI_LICENSE_FILES = LICENSE
+
+DOCKER_CLI_DEPENDENCIES = host-pkgconf
+
+DOCKER_CLI_TAGS = autogen
+DOCKER_CLI_BUILD_TARGETS = cmd/docker
+
+DOCKER_CLI_LDFLAGS = \
+       -X github.com/docker/cli/cli.GitCommit=$(DOCKER_CLI_VERSION) \
+       -X github.com/docker/cli/cli.Version=$(DOCKER_CLI_VERSION)
+
+ifeq ($(BR2_PACKAGE_DOCKER_CLI_STATIC),y)
+DOCKER_CLI_LDFLAGS += -extldflags '-static'
+DOCKER_CLI_TAGS += osusergo netgo
+DOCKER_CLI_GO_ENV = CGO_ENABLED=no
+endif
+
+DOCKER_CLI_INSTALL_BINS = $(notdir $(DOCKER_CLI_BUILD_TARGETS))
+
+$(eval $(golang-package))
index 8feb11b48c07043f01bff10aed52aaa2f0368d3b..11f17820a7ce51a225d5fd2eca93c4ce92be3c25 100644 (file)
@@ -26,12 +26,6 @@ config BR2_PACKAGE_DOCKER_ENGINE_DAEMON
 config BR2_PACKAGE_DOCKER_ENGINE_EXPERIMENTAL
        bool "build experimental features"
 
-config BR2_PACKAGE_DOCKER_ENGINE_STATIC_CLIENT
-       bool "build static client"
-       depends on !BR2_STATIC_LIBS
-       help
-         Build a static docker client.
-
 if BR2_PACKAGE_DOCKER_ENGINE_DAEMON
 
 config BR2_PACKAGE_DOCKER_ENGINE_DRIVER_BTRFS
index 6c0ed338a547ad0597c4a7a43a52eb6123b28917..1e3939f240ba5263ce02b7fecd3b7bf8b75b8ba9 100644 (file)
@@ -1,2 +1,3 @@
 # Locally calculated
-sha256 4716df117d867b82ddab2e82395cd40aa3d0925a689eedcec8919729e4c9f121        docker-engine-v17.05.0-ce.tar.gz
+sha256 b5278b3f2b460ea61f47833abd2a844f348b4518e73f309294ad178c205a48e1  docker-engine-v18.09.0.tar.gz
+sha256 2d81ea060825006fc8f3fe28aa5dc0ffeb80faf325b612c955229157b8c10dc0  LICENSE
index ba84b4cf0a1a078e2fc0a5e6803b262cd91c297a..f19c1d995cd10412037f075b63af644980804079 100644 (file)
@@ -4,25 +4,21 @@
 #
 ################################################################################
 
-DOCKER_ENGINE_VERSION = v17.05.0-ce
-DOCKER_ENGINE_COMMIT = 89658bed64c2a8fe05a978e5b87dbec409d57a0f
-DOCKER_ENGINE_SITE = $(call github,docker,docker,$(DOCKER_ENGINE_VERSION))
+DOCKER_ENGINE_VERSION = v18.09.0
+DOCKER_ENGINE_SITE = $(call github,docker,engine,$(DOCKER_ENGINE_VERSION))
 
 DOCKER_ENGINE_LICENSE = Apache-2.0
 DOCKER_ENGINE_LICENSE_FILES = LICENSE
 
-DOCKER_ENGINE_DEPENDENCIES = host-go host-pkgconf
+DOCKER_ENGINE_DEPENDENCIES = host-pkgconf
+DOCKER_ENGINE_SRC_SUBDIR = github.com/docker/docker
 
 DOCKER_ENGINE_LDFLAGS = \
        -X main.GitCommit=$(DOCKER_ENGINE_VERSION) \
        -X main.Version=$(DOCKER_ENGINE_VERSION)
 
-ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_STATIC_CLIENT),y)
-DOCKER_ENGINE_LDFLAGS += -extldflags '-static'
-endif
-
 DOCKER_ENGINE_TAGS = cgo exclude_graphdriver_zfs autogen
-DOCKER_ENGINE_BUILD_TARGETS = cmd/docker
+DOCKER_ENGINE_BUILD_TARGETS = cmd/dockerd
 
 ifeq ($(BR2_PACKAGE_LIBSECCOMP),y)
 DOCKER_ENGINE_TAGS += seccomp
@@ -30,15 +26,9 @@ DOCKER_ENGINE_DEPENDENCIES += libseccomp
 endif
 
 ifeq ($(BR2_INIT_SYSTEMD),y)
-DOCKER_ENGINE_TAGS += journald
 DOCKER_ENGINE_DEPENDENCIES += systemd
+DOCKER_ENGINE_TAGS += systemd journald
 endif
-
-ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DAEMON),y)
-DOCKER_ENGINE_TAGS += daemon
-DOCKER_ENGINE_BUILD_TARGETS += cmd/dockerd
-endif
-
 ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_EXPERIMENTAL),y)
 DOCKER_ENGINE_TAGS += experimental
 endif
@@ -65,7 +55,6 @@ DOCKER_ENGINE_INSTALL_BINS = $(notdir $(DOCKER_ENGINE_BUILD_TARGETS))
 
 define DOCKER_ENGINE_RUN_AUTOGEN
        cd $(@D) && \
-               GITCOMMIT="$$(echo $(DOCKER_ENGINE_COMMIT) | head -c7)" \
                BUILDTIME="$$(date)" \
                VERSION="$(patsubst v%,%,$(DOCKER_ENGINE_VERSION))" \
                PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" $(TARGET_MAKE_ENV) \
@@ -74,8 +63,6 @@ endef
 
 DOCKER_ENGINE_POST_CONFIGURE_HOOKS += DOCKER_ENGINE_RUN_AUTOGEN
 
-ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DAEMON),y)
-
 define DOCKER_ENGINE_INSTALL_INIT_SYSTEMD
        $(INSTALL) -D -m 0644 $(@D)/contrib/init/systemd/docker.service \
                $(TARGET_DIR)/usr/lib/systemd/system/docker.service
@@ -90,6 +77,4 @@ define DOCKER_ENGINE_USERS
        - - docker -1 * - - - Docker Application Container Framework
 endef
 
-endif
-
 $(eval $(golang-package))