I have installed docker on ubuntu 20.04 and have a problem adding Docker Compose

166 Views Asked by At

I am running ubuntu 20.04 I am using root. I have run this to install Docker:

apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Verified with:

docker run hello-world  ## ( and got the correct output )
apt-get update

It was recommended to install the compose in the /usr/local directory so that Postal can access it.

curl -SL https://github.com/docker/compose/releases/download/v2.21.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose

## Set permission to enable execution
chmod +x /usr/local/bin/docker-compose

## Create a symbolic link to the directory
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

## Check link works and compose version
docker compose version

I get "docker: 'compose' is not a docker command."

It all looks correct to me but I must have made a mistake. I have done this 3 times :(

My docker version is:


Client: Docker Engine - Community
 Version:           24.0.7
 API version:       1.43
 Go version:        go1.20.10
 Git commit:        afdd53b
 Built:             Thu Oct 26 09:08:01 2023
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          24.0.7
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.10
  Git commit:       311b9ff
  Built:            Thu Oct 26 09:08:01 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.26
  GitCommit:        3dd1e886e55dd695541fdcd67420c2888645a495
 runc:
  Version:          1.1.10
  GitCommit:        v1.1.10-0-g18a0cb0
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
1

There are 1 best solutions below

0
Dave On

The reason for using "docker compose" is because the official docker site says so.

Good catch by Stephen. Should be "docker-compose version"

enter image description here