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.

107 lines
3.2 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=docker-ce
  3. PKG_VERSION:=18.09.6
  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:=e8d2dd41e09e838e9043d4a5cf8433d8860afa20a611025621f7817b7ab16012
  10. PKG_SOURCE_VERSION:=481bc77156
  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
  15. include $(INCLUDE_DIR)/package.mk
  16. include ../../lang/golang/golang-package.mk
  17. define Package/docker-ce/config
  18. source "$(SOURCE)/Config.in"
  19. endef
  20. define Package/docker-ce
  21. SECTION:=utils
  22. CATEGORY:=Utilities
  23. TITLE:=Docker Community Edition
  24. URL:=https://www.docker.com/
  25. DEPENDS:=$(GO_ARCH_DEPENDS) @TARGET_x86_64 +btrfs-progs +libdevmapper +containerd +cgroupfs-mount +ca-certificates +iptables-mod-extra +DOCKER_SECCOMP:libseccomp \
  26. +kmod-ikconfig +kmod-veth +kmod-br-netfilter +kmod-nf-ipvs
  27. USERID:=docker:docker
  28. MENU:=1
  29. endef
  30. define Package/docker-ce/description
  31. Docker Engine is used by millions enables containerized applications
  32. to run anywhere consistently on any infrastructure.
  33. endef
  34. define Build/Configure
  35. # move so GoPackage/Build/Configure will get the correct path
  36. mv $(PKG_BUILD_DIR)/components/engine $(PKG_BUILD_DIR)/
  37. mv $(PKG_BUILD_DIR)/components/cli $(PKG_BUILD_DIR)/
  38. # docker generates files at build time so we'll just symlink for now and call GoPackage/Build/Configure later
  39. mkdir -p $(GO_PKG_BUILD_DIR)/bin \
  40. $(GO_PKG_BUILD_DIR)/src \
  41. $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)/ \
  42. $(GO_PKG_CACHE_DIR) \
  43. $(GO_PKG_TMP_DIR)
  44. $(LN) $(PKG_BUILD_DIR)/cli $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)/cli
  45. $(LN) $(PKG_BUILD_DIR)/engine $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)/docker
  46. endef
  47. ifeq ($(CONFIG_DOCKER_SECCOMP),y)
  48. BUILDTAGS:=seccomp
  49. else
  50. BUILDTAGS:=
  51. endif
  52. define Build/Compile
  53. ( \
  54. export GOPATH=$(GO_PKG_BUILD_DIR) \
  55. GOCACHE=$(GO_PKG_CACHE_DIR) \
  56. GOTMPDIR=$(GO_PKG_TMP_DIR) \
  57. GOROOT_FINAL=$(GO_TARGET_ROOT) \
  58. CC=$(TARGET_CC) \
  59. CXX=$(TARGET_CXX) \
  60. $(call GoPackage/Environment) \
  61. GITCOMMIT=$(PKG_SOURCE_VERSION) \
  62. DOCKER_GITCOMMIT=$(PKG_SOURCE_VERSION) \
  63. DOCKER_BUILDTAGS='$(BUILDTAGS)' \
  64. VERSION=$(PKG_VERSION) \
  65. \
  66. && echo "Compiling CLI..." \
  67. && cd $(PKG_BUILD_DIR)/cli \
  68. && ./scripts/build/binary \
  69. \
  70. && echo "Compiling Engine..." \
  71. && cd $(PKG_BUILD_DIR)/engine \
  72. && ./hack/make.sh binary \
  73. )
  74. # done here to include autogenerated files also
  75. rm $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)/cli
  76. rm $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)/docker
  77. $(call GoPackage/Build/Configure)
  78. endef
  79. define Package/docker-ce/install
  80. $(INSTALL_DIR) $(1)/usr/bin/
  81. $(INSTALL_BIN) $(PKG_BUILD_DIR)/cli/build/docker $(1)/usr/bin/
  82. $(INSTALL_BIN) $(PKG_BUILD_DIR)/engine/bundles/binary-daemon/dockerd $(1)/usr/bin/
  83. $(INSTALL_DIR) $(1)/opt/docker/
  84. $(INSTALL_DIR) $(1)/usr/share/docker/
  85. $(INSTALL_BIN) $(PKG_BUILD_DIR)/engine/contrib/check-config.sh $(1)/usr/share/docker/
  86. $(INSTALL_DIR) $(1)/etc/init.d
  87. $(INSTALL_BIN) ./files/dockerd.init $(1)/etc/init.d/dockerd
  88. endef
  89. $(eval $(call BuildPackage,docker-ce))