Skip to contentSkip to conversation

docker-compose: introduce pkgconfig docker-plugin

PATCH In review [email protected] 2 participants 3 messages Dec 16, 2023 – Dec 19, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 docker-compose: introduce pkgconfig docker-plugin

From: Ming Liu <[email protected]>

This allows docker-compose choose to be built as a docker plugin or a standalone binary, in the later case, docker-compose does not have to rdepends on docker, so nother container tools like podman can also use it.

---
 .../docker-compose/docker-compose_git.bb       | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
recipes-containers/docker-compose/docker-compose_git.bb +9 -9
index 092ce3d2..b7745f2b 100644
@@ -34,7 +34,8 @@ COMPATIBLE_HOST = "^(?!mips).*"
 
 do_configure[noexec] = "1"
 
-PACKAGECONFIG ?= ""
+PACKAGECONFIG ?= "docker-plugin"
+PACKAGECONFIG[docker-plugin] = ",,,docker"
 
 include relocation.inc
 
@@ -63,16 +64,15 @@ do_compile() {
 }
 
 do_install() {
-        #install -d "${D}${BIN_PREFIX}/bin"
-        #install -m 755 "${S}/src/import/bin/docker-compose" "${D}${BIN_PREFIX}/bin"
-
-	# commonly installed to: /usr/lib/docker/cli-plugins/
-	install -d "${D}${nonarch_libdir}/docker/cli-plugins/"
-	install -m 755 "${S}/src/import/bin/docker-compose" "${D}${nonarch_libdir}/docker/cli-plugins/"
-
+	if ${@bb.utils.contains('PACKAGECONFIG', 'docker-plugin', 'true', 'false', d)}; then
+		install -d ${D}${nonarch_libdir}/docker/cli-plugins
+		install -m 755 ${S}/src/import/bin/docker-compose ${D}${nonarch_libdir}/docker/cli-plugins
+	else
+		install -d ${D}${bindir}
+		install -m 755 ${S}/src/import/bin/docker-compose ${D}${bindir}
+	fi
 }
 
-RDEPENDS:${PN} += " docker"
 
 FILES:${PN} += " ${nonarch_libdir}/docker/cli-plugins/"
 
Signature · 1 line
2.34.1
#1 lore raw

In message: [meta-virtualization][PATCH] docker-compose: introduce pkgconfig docker-plugin

Quoted 6 lines · on 16/12/2023 Ming Liu wrote:

From: Ming Liu <[email protected]>

This allows docker-compose choose to be built as a docker plugin or a standalone binary, in the later case, docker-compose does not have to rdepends on docker, so nother container tools like podman can also use it.

That's how it used to be installed, but upstream broke it for a bit.

Did you test both modes ? If so, it would be nice to get a follow up patch in the form of a README in the recipe directory that indicates the test steps. That'll allow me to automate it in the future.

For now, I've staged this on master next, while we wait for those test instructions.

Bruce

Quoted 57 lines
---
 .../docker-compose/docker-compose_git.bb       | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
recipes-containers/docker-compose/docker-compose_git.bb +9 -9
index 092ce3d2..b7745f2b 100644
@@ -34,7 +34,8 @@ COMPATIBLE_HOST = "^(?!mips).*"
 
 do_configure[noexec] = "1"
 
-PACKAGECONFIG ?= ""
+PACKAGECONFIG ?= "docker-plugin"
+PACKAGECONFIG[docker-plugin] = ",,,docker"
 
 include relocation.inc
 
@@ -63,16 +64,15 @@ do_compile() {
 }
 
 do_install() {
-        #install -d "${D}${BIN_PREFIX}/bin"
-        #install -m 755 "${S}/src/import/bin/docker-compose" "${D}${BIN_PREFIX}/bin"
-
-	# commonly installed to: /usr/lib/docker/cli-plugins/
-	install -d "${D}${nonarch_libdir}/docker/cli-plugins/"
-	install -m 755 "${S}/src/import/bin/docker-compose" "${D}${nonarch_libdir}/docker/cli-plugins/"
-
+	if ${@bb.utils.contains('PACKAGECONFIG', 'docker-plugin', 'true', 'false', d)}; then
+		install -d ${D}${nonarch_libdir}/docker/cli-plugins
+		install -m 755 ${S}/src/import/bin/docker-compose ${D}${nonarch_libdir}/docker/cli-plugins
+	else
+		install -d ${D}${bindir}
+		install -m 755 ${S}/src/import/bin/docker-compose ${D}${bindir}
+	fi
 }
 
-RDEPENDS:${PN} += " docker"
 
 FILES:${PN} += " ${nonarch_libdir}/docker/cli-plugins/"
 
Signature · 11 lines
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#8510): https://lists.yoctoproject.org/g/meta-virtualization/message/8510
Mute This Topic: https://lists.yoctoproject.org/mt/103206987/1050810
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
author
#2 lore raw

Hi, Bruce:

Yes, I tested it for both docker and podman, will update readme file.

the best,
thank you

Bruce Ashfield <[email protected]> 於 2023年12月19日 週二 上午4:03寫道:

Quoted 89 lines

In message: [meta-virtualization][PATCH] docker-compose: introduce pkgconfig docker-plugin

Quoted 6 lines · on 16/12/2023 Ming Liu wrote:

From: Ming Liu <[email protected]>

This allows docker-compose choose to be built as a docker plugin or a standalone binary, in the later case, docker-compose does not have to rdepends on docker, so nother container tools like podman can also use it.

That's how it used to be installed, but upstream broke it for a bit.

Did you test both modes ? If so, it would be nice to get a follow up patch in the form of a README in the recipe directory that indicates the test steps. That'll allow me to automate it in the future.

For now, I've staged this on master next, while we wait for those test instructions.

Bruce

Review

Quoted 7 lines
---
 .../docker-compose/docker-compose_git.bb       | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
(quoted diff) +0 -0

b/recipes-containers/docker-compose/docker-compose_git.bb

Quoted 14 lines

index 092ce3d2..b7745f2b 100644

recipes-containers/docker-compose/docker-compose_git.bb +2 -1
@@ -34,7 +34,8 @@ COMPATIBLE_HOST = "^(?!mips).*"
 
 do_configure[noexec] = "1"
 
-PACKAGECONFIG ?= ""
+PACKAGECONFIG ?= "docker-plugin"
+PACKAGECONFIG[docker-plugin] = ",,,docker"
 
 include relocation.inc
 

recipes-containers/docker-compose/docker-compose_git.bb do_compile() { · line 67

Quoted 5 lines
recipes-containers/docker-compose/docker-compose_git.bb +0 -2
@@ -63,16 +64,15 @@ do_compile() {
 }
 
 do_install() {
-        #install -d "${D}${BIN_PREFIX}/bin"
-        #install -m 755 "${S}/src/import/bin/docker-compose"

"${D}${BIN_PREFIX}/bin"

recipes-containers/docker-compose/docker-compose_git.bb do_compile() {

Quoted 4 lines
recipes-containers/docker-compose/docker-compose_git.bb +0 -4
-
-     # commonly installed to: /usr/lib/docker/cli-plugins/
-     install -d "${D}${nonarch_libdir}/docker/cli-plugins/"
-     install -m 755 "${S}/src/import/bin/docker-compose"

"${D}${nonarch_libdir}/docker/cli-plugins/"

recipes-containers/docker-compose/docker-compose_git.bb do_compile() { · line 67

Quoted 2 lines
recipes-containers/docker-compose/docker-compose_git.bb +1 -1
-
+     if ${@bb.utils.contains('PACKAGECONFIG', 'docker-plugin', 'true',

'false', d)}; then

recipes-containers/docker-compose/docker-compose_git.bb do_compile() { · line 69

Quoted 2 lines
recipes-containers/docker-compose/docker-compose_git.bb +2 -0
+             install -d ${D}${nonarch_libdir}/docker/cli-plugins
+             install -m 755 ${S}/src/import/bin/docker-compose

${D}${nonarch_libdir}/docker/cli-plugins

recipes-containers/docker-compose/docker-compose_git.bb do_compile() {

Quoted 3 lines
recipes-containers/docker-compose/docker-compose_git.bb +3 -0
+     else
+             install -d ${D}${bindir}
+             install -m 755 ${S}/src/import/bin/docker-compose

${D}${bindir}

Quoted 12 lines
recipes-containers/docker-compose/docker-compose_git.bb +1 -2
+     fi
 }
 
-RDEPENDS:${PN} += " docker"
 
 FILES:${PN} += " ${nonarch_libdir}/docker/cli-plugins/"
 
--

2.34.1

Quoted 3 lines

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#8510):

https://lists.yoctoproject.org/g/meta-virtualization/message/8510

Quoted 3 lines

Mute This Topic: https://lists.yoctoproject.org/mt/103206987/1050810
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub

[[email protected]]

Quoted 2 lines

-=-=-=-=-=-=-=-=-=-=-=-