docker: Split from dockerd and update to v20.10.0
authorGerard Ryan <G.M0N3Y.2503@gmail.com>
Sun, 8 Nov 2020 02:24:23 +0000 (12:24 +1000)
committerDaniel Golle <dangowrt@users.noreply.github.com>
Tue, 15 Dec 2020 12:52:33 +0000 (12:52 +0000)
Signed-off-by: Gerard Ryan <G.M0N3Y.2503@gmail.com>
utils/docker/Makefile [new file with mode: 0644]
utils/dockerd/Makefile

diff --git a/utils/docker/Makefile b/utils/docker/Makefile
new file mode 100644 (file)
index 0000000..6fdf851
--- /dev/null
@@ -0,0 +1,53 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=docker
+PKG_VERSION:=20.10.0
+PKG_RELEASE:=1
+PKG_LICENSE:=Apache-2.0
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/docker/cli/tar.gz/v$(PKG_VERSION)?
+PKG_HASH:=5a52391fbabb0d105b2d0ed4ada762fcf24f6a80c772a9990a86af77e5dd5f10
+PKG_SOURCE_VERSION:=03fa4b8bc6 # SHA1 used within the docker executable
+
+PKG_MAINTAINER:=Gerard Ryan <G.M0N3Y.2503@gmail.com>
+
+PKG_BUILD_DEPENDS:=golang/host
+PKG_BUILD_PARALLEL:=1
+
+GO_PKG:=github.com/docker/cli
+
+include $(INCLUDE_DIR)/package.mk
+include ../../lang/golang/golang-package.mk
+
+define Package/docker
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=Docker Community Edition CLI
+  URL:=https://www.docker.com/
+  DEPENDS:=$(GO_ARCH_DEPENDS) @(aarch64||arm||x86_64)
+endef
+
+define Package/docker/description
+The CLI used in the Docker CE and Docker EE products.
+endef
+
+TAR_OPTIONS:=--strip-components 1 $(TAR_OPTIONS)
+TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
+
+define Build/Compile
+       ( \
+               cd $(PKG_BUILD_DIR); \
+               $(GO_PKG_VARS) \
+               GITCOMMIT=$(PKG_SOURCE_VERSION) \
+               VERSION=$(PKG_VERSION) \
+               ./scripts/build/binary; \
+       )
+endef
+
+define Package/docker/install
+       $(INSTALL_DIR) $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/docker $(1)/usr/bin/
+endef
+$(eval $(call BuildPackage,docker))
index cbf34025d8232f12d224c2337efd384762f0fcf7..288a18364f2773e693391ef2ee0120d105386c85 100644 (file)
@@ -4,7 +4,7 @@ PKG_NAME:=docker-ce
 PKG_VERSION:=19.03.13
 PKG_RELEASE:=5
 PKG_LICENSE:=Apache-2.0
-PKG_LICENSE_FILES:=components/cli/LICENSE components/engine/LICENSE
+PKG_LICENSE_FILES:=LICENSE
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/docker/docker-ce/tar.gz/v$(PKG_VERSION)?
@@ -71,14 +71,12 @@ endef
 define Build/Configure
        # move so GoPackage/Build/Configure will get the correct path
        mv $(PKG_BUILD_DIR)/components/engine $(PKG_BUILD_DIR)/
-       mv $(PKG_BUILD_DIR)/components/cli $(PKG_BUILD_DIR)/
 
        # docker generates files at build time so we'll just symlink for now and call GoPackage/Build/Configure later
        mkdir -p $(GO_PKG_BUILD_DIR)/bin \
                         $(GO_PKG_BUILD_DIR)/src \
                         $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)/ \
                         $(GO_BUILD_CACHE_DIR)
-       $(LN) $(PKG_BUILD_DIR)/cli $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)/cli
        $(LN) $(PKG_BUILD_DIR)/engine $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)/docker
 endef
 
@@ -96,24 +94,18 @@ define Build/Compile
                        DOCKER_BUILDTAGS='$(BUILDTAGS)' \
                        VERSION=$(PKG_VERSION) \
                \
-               && echo "Compiling CLI..." \
-               && cd $(PKG_BUILD_DIR)/cli \
-               && ./scripts/build/binary \
-               \
                && echo "Compiling Engine..." \
                && cd $(PKG_BUILD_DIR)/engine \
                && ./hack/make.sh binary \
        )
 
        # done here to include autogenerated files also
-       rm $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)/cli
        rm $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)/docker
        $(call GoPackage/Build/Configure)
 endef
 
 define Package/docker-ce/install
        $(INSTALL_DIR) $(1)/usr/bin/
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/cli/build/docker $(1)/usr/bin/
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/engine/bundles/binary-daemon/dockerd $(1)/usr/bin/
 
        $(INSTALL_DIR) $(1)/opt/docker/