docker-compose 安裝

cheFly發表於2024-04-29

1、下載最新版的docker-compose檔案

1)連結下載

https://link.zhihu.com/?target=https%3A//github.com/docker/compose/releases/download/v2.5.0/docker-compose-linux-x86_64

2)命令下載

sudo curl -L "https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

2、安裝docker-compose

若是連結下載,需要將對應的檔案上傳到/usr/local/bin/ 目錄下

cd /usr/local/bin/
mv docker-compose-linux-x86_64 docker-compose
sudo chmod +x docker-compose

3、建立軟連結以便於從任何位置呼叫 docker-compose 命令

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

4、測試安裝結果

docker-compose --version

  

  

相關文章