1 include $(TOPDIR
)/rules.mk
5 PKG_RELEASE
:=$(AUTORELEASE
)
6 PKG_LICENSE
:=Apache-2.0
7 PKG_LICENSE_FILES
:=LICENSE
9 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
10 PKG_GIT_URL
:=github.com
/moby
/moby
11 PKG_GIT_REF
:=v
$(PKG_VERSION
)
12 PKG_SOURCE_URL
:=https
://codeload.
$(PKG_GIT_URL
)/tar.gz
/$(PKG_GIT_REF
)?
13 PKG_HASH
:=061cf8579aa3c813c353c80fa480744e2f6cca2e6392f546bd0942a6a10c7a14
14 PKG_GIT_SHORT_COMMIT
:=a89b842
# SHA1 used within the docker executables
16 PKG_MAINTAINER
:=Gerard Ryan
<G.M0N3Y
.2503@gmail.com
>
18 PKG_BUILD_DEPENDS
:=golang
/host
22 GO_PKG
:=github.com
/docker
/docker
24 include $(INCLUDE_DIR
)/package.mk
25 include ..
/..
/lang
/golang
/golang-package.mk
27 define Package
/dockerd
/config
28 source
"$(SOURCE)/Config.in"
31 define Package
/dockerd
34 TITLE
:=Docker Community Edition Daemon
35 URL
:=https
://www.docker.com
/
36 DEPENDS
:=$(GO_ARCH_DEPENDS
) \
43 +KERNEL_SECCOMP
:libseccomp \
55 define Package
/dockerd
/conffiles
59 define Package
/dockerd
/description
63 GO_PKG_BUILD_VARS
+= GO111MODULE
=auto
64 TAR_OPTIONS
:=--strip-components
1 $(TAR_OPTIONS
)
65 TAR_CMD
=$(HOST_TAR
) -C
$(1) $(TAR_OPTIONS
)
66 TARGET_LDFLAGS
+= $(if
$(CONFIG_USE_GLIBC
),-lc
-lgcc_eh
)
68 # $(1) = path to dependent package 'Makefile'
69 # $(2) = relevant dependency '.installer' file
70 define EnsureVendoredVersion
72 DEP_VER
=$$$$( grep
--only-matching
--perl-regexp
'(?<=PKG_VERSION:=)(.*)' "$(1)" ); \
73 VEN_VER
=$$$$( grep
--only-matching
--perl-regexp
'(?<=_VERSION:=v)(.*)(?=})' "$(PKG_BUILD_DIR)/hack/dockerfile/install/$(2)" ); \
74 if
[ "$$$${VEN_VER}" != "$$$${DEP_VER}" ]; then \
75 echo
"ERROR: Expected 'PKG_VERSION:=$$$${VEN_VER}' in '$(1)', found 'PKG_VERSION:=$$$${DEP_VER}'"; \
81 # $(1) = path to dependent package 'Makefile'
82 # $(2) = relevant dependency '.installer' file
83 define EnsureVendoredCommit
85 DEP_VER
=$$$$( grep
--only-matching
--perl-regexp
'(?<=PKG_SOURCE_VERSION:=)(.*)' "$(1)" ); \
86 VEN_VER
=$$$$( grep
--only-matching
--perl-regexp
'(?<=_COMMIT:=)(.*)(?=})' "$(PKG_BUILD_DIR)/hack/dockerfile/install/$(2)" ); \
87 if
[ "$$$${VEN_VER}" != "$$$${DEP_VER}" ]; then \
88 echo
"ERROR: Expected 'PKG_SOURCE_VERSION:=$$$${VEN_VER}' in '$(1)', found 'PKG_SOURCE_VERSION:=$$$${DEP_VER}'"; \
95 $(Build
/Prepare
/Default
)
97 # Verify dependencies are the vendored version
98 $(call EnsureVendoredVersion
,..
/containerd
/Makefile
,containerd.installer
)
99 $(call EnsureVendoredCommit
,..
/libnetwork
/Makefile
,proxy.installer
)
100 $(call EnsureVendoredVersion
,..
/runc
/Makefile
,runc.installer
)
101 $(call EnsureVendoredVersion
,..
/tini
/Makefile
,tini.installer
)
103 # Verify CLI is the same version
105 CLI_MAKEFILE
="../docker/Makefile"; \
106 CLI_VERSION
=$$$$( grep
--only-matching
--perl-regexp
'(?<=PKG_VERSION:=)(.*)' "$$$${CLI_MAKEFILE}" ); \
107 if
[ "$$$${CLI_VERSION}" != "$(PKG_VERSION)" ]; then \
108 echo
"ERROR: Expected 'PKG_VERSION:=$(PKG_VERSION)' in '$$$${CLI_MAKEFILE}', found 'PKG_VERSION:=$$$${CLI_VERSION}'"; \
113 # Verify PKG_GIT_SHORT_COMMIT
115 EXPECTED_PKG_GIT_SHORT_COMMIT
=$$$$( $(CURDIR
)/git-short-commit.sh
'$(PKG_GIT_URL)' '$(PKG_GIT_REF)' '$(TMP_DIR)/git-short-commit/$(PKG_NAME)-$(PKG_VERSION)' ); \
116 if
[ "$$$${EXPECTED_PKG_GIT_SHORT_COMMIT}" != "$(strip $(PKG_GIT_SHORT_COMMIT))" ]; then \
117 echo
"ERROR: Expected 'PKG_GIT_SHORT_COMMIT:=$$$${EXPECTED_PKG_GIT_SHORT_COMMIT}', found 'PKG_GIT_SHORT_COMMIT:=$(strip $(PKG_GIT_SHORT_COMMIT))'"; \
124 ifeq ($(KERNEL_SECCOMP
),y
)
127 ifeq ($(CONFIG_SELINUX
),y
)
133 cd
$(PKG_BUILD_DIR
); \
135 DOCKER_GITCOMMIT
=$(PKG_GIT_SHORT_COMMIT
) \
136 DOCKER_BUILDTAGS
='$(BUILDTAGS)' \
137 VERSION
=$(PKG_VERSION
) \
138 .
/hack
/make.sh binary
; \
142 define Package
/dockerd
/install
143 $(INSTALL_DIR
) $(1)/usr
/bin
/
144 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/bundles
/binary-daemon
/dockerd
$(1)/usr
/bin
/
146 $(INSTALL_DIR
) $(1)/opt
/docker
/
148 ifeq ($(CONFIG_DOCKER_CHECK_CONFIG
),y
)
149 $(INSTALL_DIR
) $(1)/usr
/share
/docker
/
150 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/contrib
/check-config.sh
$(1)/usr
/share
/docker
/
153 $(INSTALL_DIR
) $(1)/etc
/init.d
154 $(INSTALL_BIN
) .
/files
/dockerd.init
$(1)/etc
/init.d
/dockerd
156 $(INSTALL_DIR
) $(1)/etc
/config
157 $(INSTALL_CONF
) .
/files
/etc
/config
/dockerd
$(1)/etc
/config
/dockerd
159 # Must be after systcl 11-br-netfilter.conf from kmod-br-netfilter
160 $(INSTALL_DIR
) $(1)/etc
/sysctl.d
161 $(INSTALL_DATA
) .
/files
/etc
/sysctl.d
/sysctl-br-netfilter-ip.conf \
162 $(1)/etc
/sysctl.d
/12-br-netfilter-ip.conf
165 define Package
/dockerd
/postinst
167 [ -n
"$$IPKG_INSTROOT" ] ||
{
168 /etc
/init.d
/dockerd enable
169 /etc
/init.d
/dockerd uciadd
170 /etc
/init.d
/dockerd start
174 define Package
/dockerd
/prerm
176 [ -n
"$$IPKG_INSTROOT" ] ||
{
177 /etc
/init.d
/dockerd disable
178 /etc
/init.d
/dockerd stop
179 /etc
/init.d
/dockerd ucidel
183 $(eval
$(call BuildPackage
,dockerd
))