You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

142 lines
4.0 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=dockerd
  3. PKG_VERSION:=20.10.2
  4. PKG_RELEASE:=2
  5. PKG_LICENSE:=Apache-2.0
  6. PKG_LICENSE_FILES:=LICENSE
  7. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  8. PKG_SOURCE_URL:=https://codeload.github.com/moby/moby/tar.gz/v$(PKG_VERSION)?
  9. PKG_HASH:=dc4818f0cba2ded2f6f7420a1fda027ddbf6c6c9fe319f84d1311bfe610447ca
  10. PKG_SOURCE_VERSION:=8891c58 # SHA1 used within the docker executables
  11. PKG_MAINTAINER:=Gerard Ryan <G.M0N3Y.2503@gmail.com>
  12. PKG_BUILD_DEPENDS:=golang/host
  13. PKG_BUILD_PARALLEL:=1
  14. PKG_USE_MIPS16:=0
  15. GO_PKG:=github.com/docker/docker
  16. include $(INCLUDE_DIR)/package.mk
  17. include ../../lang/golang/golang-package.mk
  18. define Package/dockerd/config
  19. source "$(SOURCE)/Config.in"
  20. endef
  21. define Package/dockerd
  22. SECTION:=utils
  23. CATEGORY:=Utilities
  24. TITLE:=Docker Community Edition Daemon
  25. URL:=https://www.docker.com/
  26. DEPENDS:=$(GO_ARCH_DEPENDS) +btrfs-progs +ca-certificates +containerd +libdevmapper +libnetwork +tini \
  27. +KERNEL_SECCOMP:libseccomp +iptables-mod-extra +kmod-br-netfilter +kmod-ikconfig +kmod-nf-conntrack-netlink +kmod-nf-ipvs \
  28. +kmod-nf-nat +kmod-veth
  29. USERID:=docker:docker
  30. MENU:=1
  31. endef
  32. define Package/dockerd/conffiles
  33. /etc/config/dockerd
  34. endef
  35. define Package/dockerd/description
  36. The Docker CE Engine.
  37. endef
  38. TAR_OPTIONS:=--strip-components 1 $(TAR_OPTIONS)
  39. TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
  40. # $(1) = path to dependent package 'Makefile'
  41. # $(2) = relevant dependency '.installer' file
  42. define EnsureVendoredVersion
  43. ( \
  44. DEP_VER=$$$$( grep --only-matching --perl-regexp '(?<=PKG_SOURCE_VERSION:=)(.*)' "$(1)" ); \
  45. VEN_VER=$$$$( grep --only-matching --perl-regexp '(?<=_COMMIT:=)(.*)(?=})' "$(PKG_BUILD_DIR)/hack/dockerfile/install/$(2)" ); \
  46. if [ $$$$VEN_VER != $$$$DEP_VER ]; then \
  47. echo "ERROR: Expected 'PKG_SOURCE_VERSION:=$$$$VEN_VER' in '$(1)', found 'PKG_SOURCE_VERSION:=$$$$DEP_VER'"; \
  48. exit 1; \
  49. fi \
  50. )
  51. endef
  52. define Build/Prepare
  53. $(Build/Prepare/Default)
  54. # Verify dependencies are the vendored version
  55. $(call EnsureVendoredVersion,../containerd/Makefile,containerd.installer)
  56. $(call EnsureVendoredVersion,../libnetwork/Makefile,proxy.installer)
  57. $(call EnsureVendoredVersion,../runc/Makefile,runc.installer)
  58. $(call EnsureVendoredVersion,../tini/Makefile,tini.installer)
  59. # Verify CLI is the same version
  60. ( \
  61. CLI_MAKEFILE="../docker/Makefile"; \
  62. CLI_VERSION=$$$$( grep --only-matching --perl-regexp '(?<=PKG_VERSION:=)(.*)' "$$$$CLI_MAKEFILE" ); \
  63. if [ $$$$CLI_VERSION != $(PKG_VERSION) ]; then \
  64. echo "ERROR: Expected 'PKG_VERSION:=$(PKG_VERSION)' in '$$$$CLI_MAKEFILE', found 'PKG_VERSION:=$$$$CLI_VERSION'"; \
  65. exit 1; \
  66. fi \
  67. )
  68. endef
  69. BUILDTAGS:=
  70. ifeq ($(KERNEL_SECCOMP),y)
  71. BUILDTAGS += seccomp
  72. endif
  73. ifeq ($(CONFIG_SELINUX),y)
  74. BUILDTAGS += selinux
  75. endif
  76. define Build/Compile
  77. ( \
  78. cd $(PKG_BUILD_DIR); \
  79. $(GO_PKG_VARS) \
  80. DOCKER_GITCOMMIT=$(PKG_SOURCE_VERSION) \
  81. DOCKER_BUILDTAGS='$(BUILDTAGS)' \
  82. VERSION=$(PKG_VERSION) \
  83. ./hack/make.sh binary; \
  84. )
  85. endef
  86. define Package/dockerd/install
  87. $(INSTALL_DIR) $(1)/usr/bin/
  88. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bundles/binary-daemon/dockerd $(1)/usr/bin/
  89. $(INSTALL_DIR) $(1)/opt/docker/
  90. $(INSTALL_DIR) $(1)/usr/share/docker/
  91. $(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/check-config.sh $(1)/usr/share/docker/
  92. $(INSTALL_DIR) $(1)/etc/init.d
  93. $(INSTALL_BIN) ./files/dockerd.init $(1)/etc/init.d/dockerd
  94. $(INSTALL_DIR) $(1)/etc/config
  95. $(INSTALL_CONF) ./files/etc/config/dockerd $(1)/etc/config/dockerd
  96. # Must be after systcl 11-br-netfilter.conf from kmod-br-netfilter
  97. $(INSTALL_DIR) $(1)/etc/sysctl.d
  98. $(INSTALL_DATA) ./files/etc/sysctl.d/sysctl-br-netfilter-ip.conf \
  99. $(1)/etc/sysctl.d/12-br-netfilter-ip.conf
  100. endef
  101. define Package/dockerd/postinst
  102. #!/bin/sh
  103. [ -n "$$IPKG_INSTROOT" ] || {
  104. /etc/init.d/dockerd enable
  105. /etc/init.d/dockerd uciadd
  106. /etc/init.d/dockerd start
  107. }
  108. endef
  109. define Package/dockerd/prerm
  110. #!/bin/sh
  111. [ -n "$$IPKG_INSTROOT" ] || {
  112. /etc/init.d/dockerd disable
  113. /etc/init.d/dockerd stop
  114. /etc/init.d/dockerd ucidel
  115. }
  116. endef
  117. $(eval $(call BuildPackage,dockerd))