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.

143 lines
4.0 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=dockerd
  3. PKG_VERSION:=20.10.2
  4. PKG_RELEASE:=5
  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. GO_PKG_BUILD_VARS += GO111MODULE=auto
  39. TAR_OPTIONS:=--strip-components 1 $(TAR_OPTIONS)
  40. TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
  41. # $(1) = path to dependent package 'Makefile'
  42. # $(2) = relevant dependency '.installer' file
  43. define EnsureVendoredVersion
  44. ( \
  45. DEP_VER=$$$$( grep --only-matching --perl-regexp '(?<=PKG_SOURCE_VERSION:=)(.*)' "$(1)" ); \
  46. VEN_VER=$$$$( grep --only-matching --perl-regexp '(?<=_COMMIT:=)(.*)(?=})' "$(PKG_BUILD_DIR)/hack/dockerfile/install/$(2)" ); \
  47. if [ $$$$VEN_VER != $$$$DEP_VER ]; then \
  48. echo "ERROR: Expected 'PKG_SOURCE_VERSION:=$$$$VEN_VER' in '$(1)', found 'PKG_SOURCE_VERSION:=$$$$DEP_VER'"; \
  49. exit 1; \
  50. fi \
  51. )
  52. endef
  53. define Build/Prepare
  54. $(Build/Prepare/Default)
  55. # Verify dependencies are the vendored version
  56. $(call EnsureVendoredVersion,../containerd/Makefile,containerd.installer)
  57. $(call EnsureVendoredVersion,../libnetwork/Makefile,proxy.installer)
  58. $(call EnsureVendoredVersion,../runc/Makefile,runc.installer)
  59. $(call EnsureVendoredVersion,../tini/Makefile,tini.installer)
  60. # Verify CLI is the same version
  61. ( \
  62. CLI_MAKEFILE="../docker/Makefile"; \
  63. CLI_VERSION=$$$$( grep --only-matching --perl-regexp '(?<=PKG_VERSION:=)(.*)' "$$$$CLI_MAKEFILE" ); \
  64. if [ $$$$CLI_VERSION != $(PKG_VERSION) ]; then \
  65. echo "ERROR: Expected 'PKG_VERSION:=$(PKG_VERSION)' in '$$$$CLI_MAKEFILE', found 'PKG_VERSION:=$$$$CLI_VERSION'"; \
  66. exit 1; \
  67. fi \
  68. )
  69. endef
  70. BUILDTAGS:=
  71. ifeq ($(KERNEL_SECCOMP),y)
  72. BUILDTAGS += seccomp
  73. endif
  74. ifeq ($(CONFIG_SELINUX),y)
  75. BUILDTAGS += selinux
  76. endif
  77. define Build/Compile
  78. ( \
  79. cd $(PKG_BUILD_DIR); \
  80. $(GO_PKG_VARS) \
  81. DOCKER_GITCOMMIT=$(PKG_SOURCE_VERSION) \
  82. DOCKER_BUILDTAGS='$(BUILDTAGS)' \
  83. VERSION=$(PKG_VERSION) \
  84. ./hack/make.sh binary; \
  85. )
  86. endef
  87. define Package/dockerd/install
  88. $(INSTALL_DIR) $(1)/usr/bin/
  89. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bundles/binary-daemon/dockerd $(1)/usr/bin/
  90. $(INSTALL_DIR) $(1)/opt/docker/
  91. $(INSTALL_DIR) $(1)/usr/share/docker/
  92. $(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/check-config.sh $(1)/usr/share/docker/
  93. $(INSTALL_DIR) $(1)/etc/init.d
  94. $(INSTALL_BIN) ./files/dockerd.init $(1)/etc/init.d/dockerd
  95. $(INSTALL_DIR) $(1)/etc/config
  96. $(INSTALL_CONF) ./files/etc/config/dockerd $(1)/etc/config/dockerd
  97. # Must be after systcl 11-br-netfilter.conf from kmod-br-netfilter
  98. $(INSTALL_DIR) $(1)/etc/sysctl.d
  99. $(INSTALL_DATA) ./files/etc/sysctl.d/sysctl-br-netfilter-ip.conf \
  100. $(1)/etc/sysctl.d/12-br-netfilter-ip.conf
  101. endef
  102. define Package/dockerd/postinst
  103. #!/bin/sh
  104. [ -n "$$IPKG_INSTROOT" ] || {
  105. /etc/init.d/dockerd enable
  106. /etc/init.d/dockerd uciadd
  107. /etc/init.d/dockerd start
  108. }
  109. endef
  110. define Package/dockerd/prerm
  111. #!/bin/sh
  112. [ -n "$$IPKG_INSTROOT" ] || {
  113. /etc/init.d/dockerd disable
  114. /etc/init.d/dockerd stop
  115. /etc/init.d/dockerd ucidel
  116. }
  117. endef
  118. $(eval $(call BuildPackage,dockerd))