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.

124 lines
4.1 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=docker-ce
  3. PKG_VERSION:=19.03.1
  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:=dad9123e203751ce9981bc34773721593655231c32412e310e748b18f10f0053
  10. PKG_SOURCE_VERSION:=74b1e89e8a
  11. PKG_MAINTAINER:=Gerard Ryan <G.M0N3Y.2503@gmail.com>
  12. define CheckExpectedSrcVer
  13. $(eval SRC_VER:=$(shell grep --only-matching --perl-regexp '(?<=PKG_SOURCE_VERSION:=)(.*)' $(1)))
  14. $(if $(subst $(2),,$(SRC_VER)), \
  15. $(error ERROR: Expected $(1) source version '$(2)', found '$(SRC_VER)'), \
  16. $(info OK: Expected $(1) source version '$(2)', found '$(SRC_VER)') \
  17. )
  18. endef
  19. # values from respective '.installer' files at https://github.com/docker/docker-ce/blob/v$(PKG_VERSION)/components/engine/hack/dockerfile/install/
  20. $(eval $(call CheckExpectedSrcVer,../containerd/Makefile,894b81a4b802e4eb2a91d1ce216b8817763c29fb))
  21. $(eval $(call CheckExpectedSrcVer,../libnetwork/Makefile,fc5a7d91d54cc98f64fc28f9e288b46a0bee756c))
  22. $(eval $(call CheckExpectedSrcVer,../runc/Makefile,425e105d5a03fabd737a126ad93d62a9eeede87f))
  23. $(eval $(call CheckExpectedSrcVer,../tini/Makefile,fec3683b971d9c3ef73f284f176672c44b448662))
  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) @TARGET_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-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/Configure
  47. # move so GoPackage/Build/Configure will get the correct path
  48. mv $(PKG_BUILD_DIR)/components/engine $(PKG_BUILD_DIR)/
  49. mv $(PKG_BUILD_DIR)/components/cli $(PKG_BUILD_DIR)/
  50. # docker generates files at build time so we'll just symlink for now and call GoPackage/Build/Configure later
  51. mkdir -p $(GO_PKG_BUILD_DIR)/bin \
  52. $(GO_PKG_BUILD_DIR)/src \
  53. $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)/ \
  54. $(GO_PKG_CACHE_DIR) \
  55. $(GO_PKG_TMP_DIR)
  56. $(LN) $(PKG_BUILD_DIR)/cli $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)/cli
  57. $(LN) $(PKG_BUILD_DIR)/engine $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)/docker
  58. endef
  59. ifeq ($(CONFIG_DOCKER_SECCOMP),y)
  60. BUILDTAGS:=seccomp
  61. else
  62. BUILDTAGS:=
  63. endif
  64. define Build/Compile
  65. ( \
  66. export GOPATH=$(GO_PKG_BUILD_DIR) \
  67. GOCACHE=$(GO_PKG_CACHE_DIR) \
  68. GOTMPDIR=$(GO_PKG_TMP_DIR) \
  69. GOROOT_FINAL=$(GO_TARGET_ROOT) \
  70. CC=$(TARGET_CC) \
  71. CXX=$(TARGET_CXX) \
  72. $(call GoPackage/Environment) \
  73. GITCOMMIT=$(PKG_SOURCE_VERSION) \
  74. DOCKER_GITCOMMIT=$(PKG_SOURCE_VERSION) \
  75. DOCKER_BUILDTAGS='$(BUILDTAGS)' \
  76. VERSION=$(PKG_VERSION) \
  77. \
  78. && echo "Compiling CLI..." \
  79. && cd $(PKG_BUILD_DIR)/cli \
  80. && ./scripts/build/binary \
  81. \
  82. && echo "Compiling Engine..." \
  83. && cd $(PKG_BUILD_DIR)/engine \
  84. && ./hack/make.sh binary \
  85. )
  86. # done here to include autogenerated files also
  87. rm $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)/cli
  88. rm $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)/docker
  89. $(call GoPackage/Build/Configure)
  90. endef
  91. define Package/docker-ce/install
  92. $(INSTALL_DIR) $(1)/usr/bin/
  93. $(INSTALL_BIN) $(PKG_BUILD_DIR)/cli/build/docker $(1)/usr/bin/
  94. $(INSTALL_BIN) $(PKG_BUILD_DIR)/engine/bundles/binary-daemon/dockerd $(1)/usr/bin/
  95. $(INSTALL_DIR) $(1)/opt/docker/
  96. $(INSTALL_DIR) $(1)/usr/share/docker/
  97. $(INSTALL_BIN) $(PKG_BUILD_DIR)/engine/contrib/check-config.sh $(1)/usr/share/docker/
  98. $(INSTALL_DIR) $(1)/etc/init.d
  99. $(INSTALL_BIN) ./files/dockerd.init $(1)/etc/init.d/dockerd
  100. $(INSTALL_DIR) $(1)/etc/docker
  101. $(INSTALL_CONF) ./files/daemon.json $(1)/etc/docker/
  102. endef
  103. $(eval $(call BuildPackage,docker-ce))