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.

118 lines
4.0 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=docker-ce
  3. PKG_VERSION:=19.03.5
  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:=d7948256e32bb4c104285d78e652ba9ead898c2e4dcee05f05ede2eaba719919
  10. PKG_SOURCE_VERSION:=633a0ea838 # SHA1 used within the docker executables
  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,b34a5c8af56e510852c35414db4c1f4fa6172339))
  21. $(eval $(call CheckExpectedSrcVer,../libnetwork/Makefile,3eb39382bfa6a3c42f83674ab080ae13b0e34e5d))
  22. $(eval $(call CheckExpectedSrcVer,../runc/Makefile,3e425f80a8c931f88e6d94a8c831b9d5aa481657))
  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) @(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/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 $(call GoPackage/Environment) \
  67. GITCOMMIT=$(PKG_SOURCE_VERSION) \
  68. DOCKER_GITCOMMIT=$(PKG_SOURCE_VERSION) \
  69. DOCKER_BUILDTAGS='$(BUILDTAGS)' \
  70. VERSION=$(PKG_VERSION) \
  71. \
  72. && echo "Compiling CLI..." \
  73. && cd $(PKG_BUILD_DIR)/cli \
  74. && ./scripts/build/binary \
  75. \
  76. && echo "Compiling Engine..." \
  77. && cd $(PKG_BUILD_DIR)/engine \
  78. && ./hack/make.sh binary \
  79. )
  80. # done here to include autogenerated files also
  81. rm $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)/cli
  82. rm $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)/docker
  83. $(call GoPackage/Build/Configure)
  84. endef
  85. define Package/docker-ce/install
  86. $(INSTALL_DIR) $(1)/usr/bin/
  87. $(INSTALL_BIN) $(PKG_BUILD_DIR)/cli/build/docker $(1)/usr/bin/
  88. $(INSTALL_BIN) $(PKG_BUILD_DIR)/engine/bundles/binary-daemon/dockerd $(1)/usr/bin/
  89. $(INSTALL_DIR) $(1)/opt/docker/
  90. $(INSTALL_DIR) $(1)/usr/share/docker/
  91. $(INSTALL_BIN) $(PKG_BUILD_DIR)/engine/contrib/check-config.sh $(1)/usr/share/docker/
  92. $(INSTALL_DIR) $(1)/etc/init.d
  93. $(INSTALL_BIN) ./files/dockerd.init $(1)/etc/init.d/dockerd
  94. $(INSTALL_DIR) $(1)/etc/docker
  95. $(INSTALL_CONF) ./files/daemon.json $(1)/etc/docker/
  96. endef
  97. $(eval $(call BuildPackage,docker-ce))