warden icon indicating copy to clipboard operation
warden copied to clipboard

Not compatible with composer V2 on Linux

Open guvra opened this issue 2 years ago • 5 comments

Hi,

I installed Docker compose v2 with the official APT repository:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin

With the above setup, docker compose is only available as a plugin:

$ docker compose version
Docker Compose version v2.4.1

$ docker-compose
Command 'docker-compose' not found

Unfortunately, Warden fails to detect compose:

$ warden
ERROR: docker-compose could not be found; please install and try again.

Adding an alias in ~/.bashrc does not resolve the issue.

Adding a custom docker-compose script in /usr/local/bin solves the detection issue, but warden still triggers an error:

$ warden
ERROR: docker-compose version should be 1.25.0 or higher (. installed)

In the warden script, the version is checked with docker-compose --version, but the command fails on compose v2. The version can only be displayed with docker compose version.

guvra avatar May 08 '22 13:05 guvra

I guess the solution will be replacing all docker-compose commands to docker compose, but that increases the minimum docker-compose version to 2.3+

ihor-sviziev avatar May 13 '22 06:05 ihor-sviziev

The docker-compose version 1.x can be installed along aside the new version. Obviously is not using the new version but till warden finds a way to be compatible with both one can still work with the old one for warden while using the new version for everything else. One other way could be the use of https://github.com/docker/compose-switch but I didn't test it myself so can't be sure how good of a solution it is.

springerin avatar May 16 '22 11:05 springerin

This is what I did to solve:

Open Docker Desktop. Go to Settings > General. Tick the "Enable Docker Compose V1/V2 compatibility mode" setting. Click "Apply & Restart".

That got it working for me instantly.

kbrownlow avatar Jun 14 '22 01:06 kbrownlow

@davidalger, looks like docker compose v1 becoming a legacy. Maybe let's release a new warden version that will start supporting the only v2?

ihor-sviziev avatar Jun 14 '22 19:06 ihor-sviziev

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Sep 16 '22 23:09 stale[bot]

Bad bot.

guvra avatar Oct 19 '22 07:10 guvra