Issue
Looks like I am having the same issue as this docker-compose-usr-local-bin-docker-compose-line-1-not-command-not-found but when I looked at my '/usr/local/bin/docker-compose' file it was not empty. Also when I try the pip install, it said 'Requirement already satisfied: docker-compose in /usr/lib/python3/dist-packages (1.27.4)' That made me think it was something else.
I am running 64 bit Ubuntu 21.10 server on an RPI 4 with 4gig memory and USB 250gig SSD. I am booting USB. I used the Raspberry Pi Imager v1.6.2 to flash the drive. The uname -r is '5.13.0-1009-raspi'
I can run 'sudo docker run hello-world:latest' without errors.
Just to be clear, my exact error:
ubuntu@ubuntu:~$ docker-compose --version
/usr/local/bin/docker-compose: line 1: Not: command not found
ubuntu@ubuntu:~$
Edit: If my assumption is correct in my answer, then it may have more to do with 64bit arm than Ubuntu. Just in case that is it, I also updated the specs above. I added it was 64 bit Ubuntu.
Solution
I found a different "How to" DOCKER ON UBUNTU RASPBERRY PI 4 From what I can remember, seems a lot like other "How to". There was this one comment.
Docker does not have a release for Docker-Compose for arm64 yet; however, I have a shell script which will allow us to download a compatible Docker-Compose container with arm64 from my GitHub.
He had one for 1.28 and one for "the latest" I used the latest
sudo curl -L --fail https://github.com/AppTower/docker-compose/releases/download/latest/run.sh -o /usr/local/bin/docker-compose
Then when I tried the docker-compose --version I got this:
ubuntu@ubuntu:~$ docker-compose --version
Unable to find image 'apptower/docker-compose:latest' locally
latest: Pulling from apptower/docker-compose
d2f70382dc9a: Pull complete
3edfa0ca360e: Pull complete
e8fa2c4aadc9: Pull complete
724e91a62418: Pull complete
Digest: sha256:3c6c36c09554b7be4faeb102758f76cb149d703865290a719f6a541ce78851d8
Status: Downloaded newer image for apptower/docker-compose:latest
docker-compose version 1.29.2, build 5becea4c
ubuntu@ubuntu:~$
Bottom line, I wish I could document for others in the same boat, but I am not sure exactly what it was that fixed it. Just that I was able to see the version. Now back to the project that I need docker for. :-)
Answered By - Paul