* [Buildroot] [PATCH 1/1] package/docker-engine: introduce static cli toggle
@ 2017-03-19 6:20 Christian Stewart
2017-03-19 20:24 ` Thomas Petazzoni
0 siblings, 1 reply; 2+ messages in thread
From: Christian Stewart @ 2017-03-19 6:20 UTC (permalink / raw)
To: buildroot
Adds an option to compile the docker CLI statically.
This is useful when bind-mounting the docker client binary into
containers for a docker-in-docker setup.
The Docker CLI communicates with the daemon over a socket. It is
sometimes useful to bind-mount the Docker CLI and socket into containers at
run-time, so that scripts within the containers can call the Docker API
in the host using a client compatible with the host daemon.
Signed-off-by: Christian Stewart <christian@paral.in>
---
package/docker-engine/Config.in | 6 ++++++
package/docker-engine/docker-engine.mk | 7 ++++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/package/docker-engine/Config.in b/package/docker-engine/Config.in
index 1879a56..7cf0d9e 100644
--- a/package/docker-engine/Config.in
+++ b/package/docker-engine/Config.in
@@ -25,6 +25,12 @@ 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
diff --git a/package/docker-engine/docker-engine.mk b/package/docker-engine/docker-engine.mk
index 7f7840b..bf6f6a4 100644
--- a/package/docker-engine/docker-engine.mk
+++ b/package/docker-engine/docker-engine.mk
@@ -28,8 +28,13 @@ DOCKER_ENGINE_GLDFLAGS = \
ifeq ($(BR2_STATIC_LIBS),y)
DOCKER_ENGINE_GLDFLAGS += -extldflags '-static'
+else
+ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_STATIC_CLIENT),y)
+DOCKER_ENGINE_GLDFLAGS_DOCKER += -extldflags '-static'
+endif
endif
+
DOCKER_ENGINE_BUILD_TAGS = cgo exclude_graphdriver_zfs autogen
DOCKER_ENGINE_BUILD_TARGETS = docker
@@ -100,7 +105,7 @@ define DOCKER_ENGINE_BUILD_CMDS
$(HOST_DIR)/usr/bin/go build -v \
-o $(@D)/bin/$(target) \
-tags "$(DOCKER_ENGINE_BUILD_TAGS)" \
- -ldflags "$(DOCKER_ENGINE_GLDFLAGS)" \
+ -ldflags "$(DOCKER_ENGINE_GLDFLAGS) $(DOCKER_ENGINE_GLDFLAGS_$(call UPPERCASE,$(target)))" \
github.com/docker/docker/cmd/$(target)
)
endef
--
2.10.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Buildroot] [PATCH 1/1] package/docker-engine: introduce static cli toggle
2017-03-19 6:20 [Buildroot] [PATCH 1/1] package/docker-engine: introduce static cli toggle Christian Stewart
@ 2017-03-19 20:24 ` Thomas Petazzoni
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2017-03-19 20:24 UTC (permalink / raw)
To: buildroot
Hello,
On Sun, 19 Mar 2017 02:20:42 -0400, Christian Stewart wrote:
> Adds an option to compile the docker CLI statically.
>
> This is useful when bind-mounting the docker client binary into
> containers for a docker-in-docker setup.
>
> The Docker CLI communicates with the daemon over a socket. It is
> sometimes useful to bind-mount the Docker CLI and socket into containers at
> run-time, so that scripts within the containers can call the Docker API
> in the host using a client compatible with the host daemon.
>
> Signed-off-by: Christian Stewart <christian@paral.in>
> ---
> package/docker-engine/Config.in | 6 ++++++
> package/docker-engine/docker-engine.mk | 7 ++++++-
> 2 files changed, 12 insertions(+), 1 deletion(-)
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-03-19 20:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-19 6:20 [Buildroot] [PATCH 1/1] package/docker-engine: introduce static cli toggle Christian Stewart
2017-03-19 20:24 ` Thomas Petazzoni
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.