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.

141 lines
4.0 KiB

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