termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
12.62k stars 2.91k forks source link

[Bug]: Docker compose is not installed as CLI plugin #20491

Open ygottlieb-peratonlabs-com opened 3 weeks ago

ygottlieb-peratonlabs-com commented 3 weeks ago

Problem description

When installing the docker-compose package, the installed binary cannot be called as docker compose, rather it must be called as docker-compose

What steps will reproduce the bug?

  1. Install docker-compose pkg install docker-compose
  2. Run a compose command docker compose

The result is

docker: 'compose' is not a docker command.
See 'docker --help'

What is the expected behavior?

Docker should display the compose help:

Usage:  docker compose [OPTIONS] COMMAND

Define and run multi-container applications with Docker

Options:

System information

Termux Variables:
TERMUX_APK_RELEASE=GITHUB
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=2757
TERMUX_IS_DEBUGGABLE_BUILD=1
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
TERMUX__USER_ID=0
Packages CPU architecture:
x86_64
Subscribed repositories:
# sources.list
deb https://ftp.fau.de/termux/termux-main stable main
# root-repo (sources.list.d/root.list)
deb https://ftp.fau.de/termux/termux-root root stable
Updatable packages:
All packages up to date
termux-tools version:
1.42.4
Android version:
9
Kernel build information:
Linux phone1 4.19.195-android-x86_64-g8a9ae81896cb-dirty #8 SMP PREEMPT Wed Nov 22 20:19:56 UTC 2023 x86_64 Android
Device manufacturer:
QEMU
Device model:
Standard PC (i440FX + PIIX, 1996)
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
ygottlieb-peratonlabs-com commented 3 weeks ago

Fixing this requires two separate fixes:

  1. docker-compose/build.sh must install docker-compose in @TERMUX_PREFIX@/libexec/docker/cli-plugins/.
  2. Docker's cli/cli-plugins/manager/manager_unix.go must be patched to prepend @TERMUX_PREFIX@ to each element in the array.