Docker Compose 安裝與部署

Decalogue發表於2020-12-15

官方網站:

https://github.com/docker/compose/releases

菜鳥教室:

https://www.runoob.com/docker/docker-compose.html

Compose 安裝

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

這裡面有個疑問:uname是什麼意思呢?命令列意思不明確。

 

將可執行許可權應用於二進位制檔案:

sudo chmod +x /usr/local/bin/docker-compose

建立軟鏈:

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

測試是否安裝成功

docker-compose --version

解除安裝和刪除

sudo rm /usr/local/bin/docker-compose

 

 

 

========================另外一種方式,似乎更加正規==========================================

curl -L https://github.com/docker/compose/releases/download/1.27.4/run.sh > /usr/local/bin/docker-compose

chmod +x /usr/local/bin/docker-compose

建立軟鏈,讓該軟體可以隨時訪問:

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

docker-compose --version

相關文章