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.

132 lines
4.3 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=docker-ce
  3. PKG_VERSION:=19.03.12
  4. PKG_RELEASE:=1
  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/description
  43. Docker Engine is used by millions enables containerized applications
  44. to run anywhere consistently on any infrastructure.
  45. endef
  46. define Build/Prepare
  47. $(Build/Prepare/Default)
  48. # Verify dependencies are the vendored version
  49. $(call EnsureVendoredVersion,../containerd/Makefile,containerd.installer)
  50. $(call EnsureVendoredVersion,../libnetwork/Makefile,proxy.installer)
  51. $(call EnsureVendoredVersion,../runc/Makefile,runc.installer)
  52. $(call EnsureVendoredVersion,../tini/Makefile,tini.installer)
  53. endef
  54. define Build/Configure
  55. # move so GoPackage/Build/Configure will get the correct path
  56. mv $(PKG_BUILD_DIR)/components/engine $(PKG_BUILD_DIR)/
  57. mv $(PKG_BUILD_DIR)/components/cli $(PKG_BUILD_DIR)/
  58. # docker generates files at build time so we'll just symlink for now and call GoPackage/Build/Configure later
  59. mkdir -p $(GO_PKG_BUILD_DIR)/bin \
  60. $(GO_PKG_BUILD_DIR)/src \
  61. $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)/ \
  62. $(GO_PKG_CACHE_DIR) \
  63. $(GO_PKG_TMP_DIR)
  64. $(LN) $(PKG_BUILD_DIR)/cli $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)/cli
  65. $(LN) $(PKG_BUILD_DIR)/engine $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)/docker
  66. endef
  67. ifeq ($(CONFIG_DOCKER_SECCOMP),y)
  68. BUILDTAGS:=seccomp
  69. else
  70. BUILDTAGS:=
  71. endif
  72. define Build/Compile
  73. ( \
  74. export $(GO_PKG_VARS) \
  75. GITCOMMIT=$(PKG_SOURCE_VERSION) \
  76. DOCKER_GITCOMMIT=$(PKG_SOURCE_VERSION) \
  77. DOCKER_BUILDTAGS='$(BUILDTAGS)' \
  78. VERSION=$(PKG_VERSION) \
  79. \
  80. && echo "Compiling CLI..." \
  81. && cd $(PKG_BUILD_DIR)/cli \
  82. && ./scripts/build/binary \
  83. \
  84. && echo "Compiling Engine..." \
  85. && cd $(PKG_BUILD_DIR)/engine \
  86. && ./hack/make.sh binary \
  87. )
  88. # done here to include autogenerated files also
  89. rm $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)/cli
  90. rm $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)/docker
  91. $(call GoPackage/Build/Configure)
  92. endef
  93. define Package/docker-ce/install
  94. $(INSTALL_DIR) $(1)/usr/bin/
  95. $(INSTALL_BIN) $(PKG_BUILD_DIR)/cli/build/docker $(1)/usr/bin/
  96. $(INSTALL_BIN) $(PKG_BUILD_DIR)/engine/bundles/binary-daemon/dockerd $(1)/usr/bin/
  97. $(INSTALL_DIR) $(1)/opt/docker/
  98. $(INSTALL_DIR) $(1)/usr/share/docker/
  99. $(INSTALL_BIN) $(PKG_BUILD_DIR)/engine/contrib/check-config.sh $(1)/usr/share/docker/
  100. $(INSTALL_DIR) $(1)/etc/init.d
  101. $(INSTALL_BIN) ./files/dockerd.init $(1)/etc/init.d/dockerd
  102. $(INSTALL_DIR) $(1)/etc/docker
  103. $(INSTALL_CONF) ./files/daemon.json $(1)/etc/docker/
  104. # Must be after systcl 11-br-netfilter.conf from kmod-br-netfilter
  105. $(INSTALL_DIR) $(1)/etc/sysctl.d
  106. $(INSTALL_DATA) ./files/etc/sysctl.d/sysctl-br-netfilter-ip.conf \
  107. $(1)/etc/sysctl.d/12-br-netfilter-ip.conf
  108. endef
  109. $(eval $(call BuildPackage,docker-ce))