Docker commands out of date
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
- Install the latest Docker on a new Linux machine.
- 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.
This command may help you
sed -i 's/docker-compose /docker compose /' filename
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.
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.