我已经在ubuntu 20.04上安装了docker,在添加Docker Compose时遇到了问题

ghg1uchk  于 5个月前  发布在  Docker
关注(0)|答案(1)|浏览(70)

我运行的是ubuntu 20.04,我使用的是root。我已经运行这个来安装Docker:

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

字符串
验证人:

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


建议将编写安装在/usr/local目录中,以便Postal可以访问它。

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


我得到“docker:'compose'不是docker命令”。
这一切看起来对我来说都是正确的,但我一定是犯了一个错误。我已经这样做了3次:(
Docker版本是:

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

zy1mlcev

zy1mlcev1#

之所以使用“docker compose”,是因为官方的docker站点是这么说的。
斯蒂芬接得好。应该是“码头编辑版本”


的数据

相关问题