docker-magento icon indicating copy to clipboard operation
docker-magento copied to clipboard

Docker commands out of date

Open LetMyPeopleCode opened this issue 3 years ago • 3 comments

Description The docker-compose command has not only been deprecated in favor of docker compose (no dash), but newer installations of Docker do not have docker-compose. Seems this happened about 5-6 weeks ago when Docker Compose v2 went GA in April 2022.

Steps To Reproduce

  1. Install the latest Docker on a new Linux machine.
  2. Run the one-line curl and execute script.

Expected Result Script runs and Magento containers are set up.

Actual Result Script fails because there is no docker-compose in /bin/.

FIX: Add a small section instructing users to check their Docker version. docker --version. If it's 20.10.15 or higher, it's after the Compose V2 GA date. I have 20.10.16 installed.

You can either create a second copy of the script, but with docker compose or suggest they use this fix I borrowed from Stack Overflow (or you can do it for them since you get permissions to alter the hosts file).

sudo touch /bin/docker-compose
[open /bin/docker-compose in your favorite editor]
[add]
docker compose "$@"
[hit enter]
[save and quit]
sudo chmod +x /bin/docker-compose

Did the trick for me.

LetMyPeopleCode avatar Jun 03 '22 21:06 LetMyPeopleCode

This command may help you

sed -i 's/docker-compose /docker compose /' filename

rangerz avatar Jun 07 '22 20:06 rangerz

Everything still works for me as-is.

@LetMyPeopleCode -- what operating system are you running? I'm wondering if Docker borked something for non-Docker-desktop setups.

markshust avatar Jun 13 '22 19:06 markshust

It was actually Docker Desktop on Ubuntu 22.04. The last two dot releases favored compose in the Go-based CLI (docker compose) vs the Python-based docker-compose. Python based one needed to be installed separately.

I found that when I installed Desktop on Mac and Windows, Mac auto-aliased to the CLI version and Windows had both options separately.

LetMyPeopleCode avatar Jun 13 '22 19:06 LetMyPeopleCode