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.

136 lines
4.3 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=docker-ce
  3. PKG_VERSION:=19.03.12
  4. PKG_RELEASE:=2
  5. PKG_LICENSE:=Apache-2.0
  6. PKG_LICENSE_FILES:=components/cli/LICENSE components/engine/LICENSE
  7. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  8. PKG_SOURCE_URL:=https://codeload.github.com/docker/docker-ce/tar.gz/v$(PKG_VERSION)?
  9. PKG_HASH:=d321f959e41fd9b24c23d95779d30d9ead1120bfddedf157ef5c047cf3d997a1
  10. PKG_SOURCE_VERSION:=48a66213fe # SHA1 used within the docker executables
  11. PKG_MAINTAINER:=Gerard Ryan <G.M0N3Y.2503@gmail.com>
  12. # $(1) = path to dependent package 'Makefile'
  13. # $(2) = relevant docker-ce '.installer' file
  14. define EnsureVendoredVersion
  15. ( \
  16. DEP_VER=$$$$( grep --only-matching --perl-regexp '(?<=PKG_SOURCE_VERSION:=)(.*)' "$(1)" ); \
  17. VEN_VER=$$$$( grep --only-matching --perl-regexp '(?<=_COMMIT:=)(.*)(?=})' "$(PKG_BUILD_DIR)/components/engine/hack/dockerfile/install/$(2)" ); \
  18. if [ $$$$VEN_VER != $$$$DEP_VER ]; then \
  19. echo "ERROR: Expected 'PKG_SOURCE_VERSION:=$$$$VEN_VER' in '$(1)', found 'PKG_SOURCE_VERSION:=$$$$DEP_VER'"; \
  20. exit 1; \
  21. fi \
  22. )
  23. endef
  24. PKG_BUILD_DEPENDS:=golang/host
  25. PKG_BUILD_PARALLEL:=1
  26. GO_PKG:=github.com/docker
  27. include $(INCLUDE_DIR)/package.mk
  28. include ../../lang/golang/golang-package.mk
  29. define Package/docker-ce/config
  30. source "$(SOURCE)/Config.in"
  31. endef
  32. define Package/docker-ce
  33. SECTION:=utils
  34. CATEGORY:=Utilities
  35. TITLE:=Docker Community Edition
  36. URL:=https://www.docker.com/
  37. DEPENDS:=$(GO_ARCH_DEPENDS) @(aarch64||arm||x86_64) +btrfs-progs +ca-certificates +cgroupfs-mount +containerd +libdevmapper +libnetwork +tini \
  38. +DOCKER_SECCOMP:libseccomp +iptables-mod-extra +kmod-br-netfilter +kmod-ikconfig +kmod-nf-conntrack-netlink +kmod-nf-ipvs +kmod-veth
  39. USERID:=docker:docker
  40. MENU:=1
  41. endef
  42. define Package/docker-ce/conffiles
  43. /etc/config/dockerd
  44. endef
  45. define Package/docker-ce/description
  46. Docker Engine is used by millions enables containerized applications
  47. to run anywhere consistently on any infrastructure.
  48. endef
  49. define Build/Prepare
  50. $(Build/Prepare/Default)
  51. # Verify dependencies are the vendored version
  52. $(call EnsureVendoredVersion,../containerd/Makefile,containerd.installer)
  53. $(call EnsureVendoredVersion,../libnetwork/Makefile,proxy.installer)
  54. $(call EnsureVendoredVersion,../runc/Makefile,runc.installer)
  55. $(call EnsureVendoredVersion,../tini/Makefile,tini.installer)
  56. endef
  57. define Build/Configure
  58. # move so GoPackage/Build/Configure will get the correct path
  59. mv $(PKG_BUILD_DIR)/components/engine $(PKG_BUILD_DIR)/
  60. mv $(PKG_BUILD_DIR)/components/cli $(PKG_BUILD_DIR)/
  61. # docker generates files at build time so we'll just symlink for now and call GoPackage/Build/Configure later
  62. mkdir -p $(GO_PKG_BUILD_DIR)/bin \
  63. $(GO_PKG_BUILD_DIR)/src \
  64. $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)/ \
  65. $(GO_PKG_CACHE_DIR) \
  66. $(GO_PKG_TMP_DIR)
  67. $(LN) $(PKG_BUILD_DIR)/cli $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)/cli
  68. $(LN) $(PKG_BUILD_DIR)/engine $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)/docker
  69. endef
  70. ifeq ($(CONFIG_DOCKER_SECCOMP),y)
  71. BUILDTAGS:=seccomp
  72. else
  73. BUILDTAGS:=
  74. endif
  75. define Build/Compile
  76. ( \
  77. export $(GO_PKG_VARS) \
  78. GITCOMMIT=$(PKG_SOURCE_VERSION) \
  79. DOCKER_GITCOMMIT=$(PKG_SOURCE_VERSION) \
  80. DOCKER_BUILDTAGS='$(BUILDTAGS)' \
  81. VERSION=$(PKG_VERSION) \
  82. \
  83. && echo "Compiling CLI..." \
  84. && cd $(PKG_BUILD_DIR)/cli \
  85. && ./scripts/build/binary \
  86. \
  87. && echo "Compiling Engine..." \
  88. && cd $(PKG_BUILD_DIR)/engine \
  89. && ./hack/make.sh binary \
  90. )
  91. # done here to include autogenerated files also
  92. rm $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)/cli
  93. rm $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)/docker
  94. $(call GoPackage/Build/Configure)
  95. endef
  96. define Package/docker-ce/install
  97. $(INSTALL_DIR) $(1)/usr/bin/
  98. $(INSTALL_BIN) $(PKG_BUILD_DIR)/cli/build/docker $(1)/usr/bin/
  99. $(INSTALL_BIN) $(PKG_BUILD_DIR)/engine/bundles/binary-daemon/dockerd $(1)/usr/bin/
  100. $(INSTALL_DIR) $(1)/opt/docker/
  101. $(INSTALL_DIR) $(1)/usr/share/docker/
  102. $(INSTALL_BIN) $(PKG_BUILD_DIR)/engine/contrib/check-config.sh $(1)/usr/share/docker/
  103. $(INSTALL_DIR) $(1)/etc/init.d
  104. $(INSTALL_BIN) ./files/dockerd.init $(1)/etc/init.d/dockerd
  105. $(INSTALL_DIR) $(1)/etc/config
  106. $(INSTALL_CONF) ./files/etc/config/dockerd $(1)/etc/config/dockerd
  107. # Must be after systcl 11-br-netfilter.conf from kmod-br-netfilter
  108. $(INSTALL_DIR) $(1)/etc/sysctl.d
  109. $(INSTALL_DATA) ./files/etc/sysctl.d/sysctl-br-netfilter-ip.conf \
  110. $(1)/etc/sysctl.d/12-br-netfilter-ip.conf
  111. endef
  112. $(eval $(call BuildPackage,docker-ce))