Cannot install Docker Compose v2: "Invalid Plugin, exec format error"

  docker, docker-compose, ubuntu-20.04

I installed the new docker compose CLI according to the instructions on (Ubuntu 20.04) and cannot use the plugin.

The command docker compose help shows:

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

When running docker help, I get:

$ docker help

Usage:  docker [OPTIONS] COMMAND


Invalid Plugins:
  compose     failed to fetch metadata: fork/exec /home/myname/.docker/cli-plugins/docker-compose: exec format error

Run 'docker COMMAND --help' for more information on a command.

To get more help with docker, check out our guides at

Same when installing under /usr/local/lib/docker/cli-plugins and running the command as root.

I currently use docker version 20.10.7 and docker-compose version 1.28.0.

What am I doing wrong? How to get the new compose to work?

Source: Docker Questions