board/csky: fixup gdb instructions in readme.txt
[buildroot-gz.git] / package / docker-engine / docker-engine.mk
blobbf6f6a4b0dc61ed67037466d4483bff4a2d98e2a
1 ################################################################################
3 # docker-engine
5 ################################################################################
7 DOCKER_ENGINE_VERSION = v17.03.0-ce
8 DOCKER_ENGINE_COMMIT = 60ccb2265b0574d6c1c1090876a1d1ab32bed60e
9 DOCKER_ENGINE_SITE = $(call github,docker,docker,$(DOCKER_ENGINE_VERSION))
11 DOCKER_ENGINE_LICENSE = Apache-2.0
12 DOCKER_ENGINE_LICENSE_FILES = LICENSE
14 DOCKER_ENGINE_DEPENDENCIES = host-go host-pkgconf
16 DOCKER_ENGINE_GOPATH = "$(@D)/vendor"
17 DOCKER_ENGINE_MAKE_ENV = $(HOST_GO_TARGET_ENV) \
18 CGO_ENABLED=1 \
19 CGO_NO_EMULATION=1 \
20 GOBIN="$(@D)/bin" \
21 GOPATH="$(DOCKER_ENGINE_GOPATH)" \
22 PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
23 $(TARGET_MAKE_ENV)
25 DOCKER_ENGINE_GLDFLAGS = \
26 -X main.GitCommit=$(DOCKER_ENGINE_VERSION) \
27 -X main.Version=$(DOCKER_ENGINE_VERSION)
29 ifeq ($(BR2_STATIC_LIBS),y)
30 DOCKER_ENGINE_GLDFLAGS += -extldflags '-static'
31 else
32 ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_STATIC_CLIENT),y)
33 DOCKER_ENGINE_GLDFLAGS_DOCKER += -extldflags '-static'
34 endif
35 endif
38 DOCKER_ENGINE_BUILD_TAGS = cgo exclude_graphdriver_zfs autogen
39 DOCKER_ENGINE_BUILD_TARGETS = docker
41 ifeq ($(BR2_PACKAGE_LIBSECCOMP),y)
42 DOCKER_ENGINE_BUILD_TAGS += seccomp
43 DOCKER_ENGINE_DEPENDENCIES += libseccomp
44 endif
46 ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DAEMON),y)
47 DOCKER_ENGINE_BUILD_TAGS += daemon
48 DOCKER_ENGINE_BUILD_TARGETS += dockerd
49 endif
51 ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_EXPERIMENTAL),y)
52 DOCKER_ENGINE_BUILD_TAGS += experimental
53 endif
55 ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DRIVER_BTRFS),y)
56 DOCKER_ENGINE_DEPENDENCIES += btrfs-progs
57 else
58 DOCKER_ENGINE_BUILD_TAGS += exclude_graphdriver_btrfs
59 endif
61 ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DRIVER_DEVICEMAPPER),y)
62 DOCKER_ENGINE_DEPENDENCIES += lvm2
63 else
64 DOCKER_ENGINE_BUILD_TAGS += exclude_graphdriver_devicemapper
65 endif
67 ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DRIVER_VFS),y)
68 DOCKER_ENGINE_DEPENDENCIES += gvfs
69 else
70 DOCKER_ENGINE_BUILD_TAGS += exclude_graphdriver_vfs
71 endif
73 define DOCKER_ENGINE_CONFIGURE_CMDS
74 mkdir -p $(DOCKER_ENGINE_GOPATH)/src/github.com/docker
75 ln -fs $(@D) $(DOCKER_ENGINE_GOPATH)/src/github.com/docker/docker
76 cd $(@D) && \
77 GITCOMMIT="$$(echo $(DOCKER_ENGINE_COMMIT) | head -c7)" \
78 BUILDTIME="$$(date)" \
79 VERSION="$(patsubst v%,%,$(DOCKER_ENGINE_VERSION))" \
80 PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" $(TARGET_MAKE_ENV) \
81 bash ./hack/make/.go-autogen
82 endef
84 ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DAEMON),y)
86 define DOCKER_ENGINE_INSTALL_INIT_SYSTEMD
87 $(INSTALL) -D -m 0644 $(@D)/contrib/init/systemd/docker.service \
88 $(TARGET_DIR)/usr/lib/systemd/system/docker.service
89 $(INSTALL) -D -m 0644 $(@D)/contrib/init/systemd/docker.socket \
90 $(TARGET_DIR)/usr/lib/systemd/system/docker.socket
91 mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/
92 ln -fs ../../../../usr/lib/systemd/system/docker.service \
93 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/docker.service
94 endef
96 define DOCKER_ENGINE_USERS
97 - - docker -1 * - - - Docker Application Container Framework
98 endef
100 endif
102 define DOCKER_ENGINE_BUILD_CMDS
103 $(foreach target,$(DOCKER_ENGINE_BUILD_TARGETS), \
104 cd $(@D); $(DOCKER_ENGINE_MAKE_ENV) \
105 $(HOST_DIR)/usr/bin/go build -v \
106 -o $(@D)/bin/$(target) \
107 -tags "$(DOCKER_ENGINE_BUILD_TAGS)" \
108 -ldflags "$(DOCKER_ENGINE_GLDFLAGS) $(DOCKER_ENGINE_GLDFLAGS_$(call UPPERCASE,$(target)))" \
109 github.com/docker/docker/cmd/$(target)
111 endef
113 define DOCKER_ENGINE_INSTALL_TARGET_CMDS
114 $(foreach target,$(DOCKER_ENGINE_BUILD_TARGETS), \
115 $(INSTALL) -D -m 0755 $(@D)/bin/$(target) $(TARGET_DIR)/usr/bin/$(target)
117 endef
119 $(eval $(generic-package))