package/docker-cli-buildx: new package

buildx is a docker CLI plugin implementing extended build features.

buildx is the default builder as of Docker v23.x, and if the plugin is not
present, the CLI will output an error warning that it is using the deprecated
built-in builder instead of the buildx builder.

However, buildx is a separate repository from docker-cli: it is a plugin that
needs to be installed at /usr/lib/docker/cli-plugins on the target.

https://github.com/docker/buildx

Signed-off-by: Christian Stewart <christian@aperture.us>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Christian Stewart 2023-07-23 18:09:07 -07:00 committed by Thomas Petazzoni
commit 22579ce771
4 changed files with 56 additions and 0 deletions

View file

@ -2757,6 +2757,7 @@ menu "System tools"
source "package/ddrescue/Config.in"
source "package/debianutils/Config.in"
source "package/docker-cli/Config.in"
source "package/docker-cli-buildx/Config.in"
source "package/docker-compose/Config.in"
source "package/docker-engine/Config.in"
source "package/earlyoom/Config.in"

View file

@ -0,0 +1,16 @@
config BR2_PACKAGE_DOCKER_CLI_BUILDX
bool "docker-cli-buildx"
depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS
depends on BR2_TOOLCHAIN_HAS_THREADS
select BR2_PACKAGE_DOCKER_CLI
help
buildx is a Docker CLI plugin for extended build
capabilities with BuildKit.
https://github.com/docker/buildx
comment "docker-cli-buildx needs a toolchain w/ threads"
depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS
depends on !BR2_TOOLCHAIN_HAS_THREADS

View file

@ -0,0 +1,3 @@
# Locally calculated
sha256 371eb742213ed580179fc4fdfd9a197f0e3115e91979b7907828427d578d49e5 docker-cli-buildx-0.11.2-go2.tar.gz
sha256 cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 LICENSE

View file

@ -0,0 +1,36 @@
################################################################################
#
# docker-cli-buildx
#
################################################################################
DOCKER_CLI_BUILDX_VERSION = 0.11.2
DOCKER_CLI_BUILDX_SITE = $(call github,docker,buildx,v$(DOCKER_CLI_BUILDX_VERSION))
DOCKER_CLI_BUILDX_LICENSE = Apache-2.0
DOCKER_CLI_BUILDX_LICENSE_FILES = LICENSE
DOCKER_CLI_BUILDX_DEPENDENCIES = host-pkgconf
DOCKER_CLI_BUILDX_BUILD_TARGETS = cmd/buildx
DOCKER_CLI_BUILDX_GOMOD = github.com/docker/buildx
DOCKER_CLI_BUILDX_LDFLAGS = \
-X $(DOCKER_CLI_BUILDX_GOMOD)/version.Revision=$(DOCKER_CLI_BUILDX_VERSION) \
-X $(DOCKER_CLI_BUILDX_GOMOD)/version.Version=$(DOCKER_CLI_BUILDX_VERSION)
# create the go.mod file with required language version go1.20
# remove the conflicting vendor/modules.txt
# https://github.com/moby/moby/issues/44618#issuecomment-1343565705
define DOCKER_CLI_BUILDX_FIX_VENDORING
printf "module $(DOCKER_CLI_BUILDX_GOMOD)\n\ngo 1.20\n" > $(@D)/go.mod
rm -f $(@D)/vendor/modules.txt
endef
DOCKER_CLI_BUILDX_POST_EXTRACT_HOOKS += DOCKER_CLI_BUILDX_FIX_VENDORING
define DOCKER_CLI_BUILDX_INSTALL_TARGET_CMDS
$(INSTALL) -m 0755 -D $(@D)/bin/buildx \
$(TARGET_DIR)/usr/lib/docker/cli-plugins/docker-buildx
endef
$(eval $(golang-package))