Answered
How do I check if Docker compose is installed on my machine?
Can I do this via the command line?
My macOS machine is running Monterey version 12.3.
You can just execute the docker-compose
command:
docker-compose
If docker-compose
is installed on your machine, it should list out the commands:
Usage: docker compose [OPTIONS] COMMAND
Docker Compose
Options:
--ansi string Control when to print ANSI control characters ("never"|"always"|"auto") (default "auto")
--compatibility Run compose in backward compatibility mode
--env-file string Specify an alternate environment file.
-f, --file stringArray Compose configuration files
--profile stringArray Specify a profile to enable
--project-directory string Specify an alternate working directory
(default: the path of the Compose file)
-p, --project-name string Project name
Commands:
build Build or rebuild services
convert Converts the compose file to platform's canonical format
. . .
If not, you'll get an error output similar to this:
-bash: docker-compose: command not found
Execute this command to get the version of docker-compose
installed on your machine:
docker-compose --version
If docker-compose
is installed to your machine, it should output a version number like this:
Docker Compose version 2.4.1
The which
command should work for this:
which docker-compose
If Docker Compose is installed on you machine, it should output the path to the executive:
/opt/homebrew/bin/docker-compose