2

I have installed docker-ce, docker-compose and the docker-compose-plugin package on Ubuntu 22.04 from the Docker apt repository, following the official instructions, but when I type docker compose on the command line all I get is this:

docker: 'compose' is not a docker command.
See 'docker --help'

According to docker plugin ls, no plugin has been installed. Any clues?

Some additional information:

  • bash-completion does suggests compose as a possible subcommand
  • There is a working docker-compose executable in /usr/libexec/docker/cli-plugins/
  • The output of dpkg -l | grep docker is as follows:
    ii  docker-buildx-plugin                                        0.10.2-1~ubuntu.22.04~jammy                                    amd64        Docker Buildx cli plugin.
    ii  docker-ce                                                   5:23.0.1-1~ubuntu.22.04~jammy                                  amd64        Docker: the open-source application container engine
    ii  docker-ce-cli                                               5:23.0.1-1~ubuntu.22.04~jammy                                  amd64        Docker CLI: the open-source application container engine
    ii  docker-ce-rootless-extras                                   5:23.0.1-1~ubuntu.22.04~jammy                                  amd64        Rootless support for Docker.
    ii  docker-compose-plugin                                       2.16.0-1~ubuntu.22.04~jammy                                    amd64        Docker Compose (V2) plugin for the Docker CLI.
    ii  docker-scan-plugin                                          0.23.0~ubuntu-jammy                                            amd64        Docker scan cli plugin.
Aldo
  • 141
  • 1
    Hi Aldo, 1) please edit your question and add the result of dpkg -l | grep docker 2) how did you install docker itself ? – dummyuser Feb 13 '23 at 15:45
  • Hi @dummyuser, thank you for answering. I installed docker via apt from the repository https://download.docker.com/linux/ubuntu following the instruction on the webpage mentioned above. – Aldo Feb 14 '23 at 11:04
  • Please add output of docker info, docker version and snap list .. – Artur Meinild Feb 14 '23 at 11:58
  • Thank you @ArturMeinild, you pointed me in the right direction! In the output of docker info there was the line
    WARNING: Plugin "/home/aldo/.docker/cli-plugins/docker-compose" is not valid: failed to fetch metadata: fork/exec /home/aldo/.docker/cli-plugins/docker-compose: permission denied
    

    For some reason that file was a text file with only "Not Found" in it. After I got rid of it docker compose started working, and the output of docker info now points to the plugins in /usr/libexec/docker/cli-plugins/

    – Aldo Feb 14 '23 at 16:15
  • That's good to hear. Please post your findings as an answer, as it might help others. Thanks! – Artur Meinild Feb 14 '23 at 16:41

1 Answers1

2

Examination of the output of docker info led me to the solution to the problem. It did indeed contain the line:

WARNING: Plugin "/home/aldo/.docker/cli-plugins/docker-compose" is not valid: failed to fetch metadata: fork/exec /home/aldo/.docker/cli-plugins/docker-compose: permission denied

I'm not sure what might have created it, but in the directory ~/.docker/cli-plugins/ there was a docker-compose text file, only containing the words "Not Found". Simply deleting it solved my problem, and now docker finds the default path to the plugin executable /usr/libexec/docker/cli-plugins/docker-compose.

Aldo
  • 141