attempting to run
sudo /usr/local/bin/docker compose exec -T ...
in order to backup a database file
however when referencing documents I see that docker-compose is typically what was there for v1
for v2 what syntax do I have to use so I don't get sudo: /usr/local/bin/docker: command not found
I would like to use the proper v2 version but I don't know how to execute docker compose exec with correct syntax and online documentation is not clear as to why this issue exists or what I should be doing to fix it.
Just bringing my comment out here as an answer for future readers.
On my system, docker is installed at the location
/usr/bin/docker.The following command works for me
and this command
produces the error
sudo: /usr/local/bin/docker: command not found.Verifying the location of your docker install may help solve this issue.
Since my
$PATHincludes bothbinlocations, I usedto find my install location.
An additional note:
If your install location is in your
$PATH(check withecho $PATH), you can use the docker command directly in your shell or scripts.I usually use a shorter
which locates the executable for me.