簡體   English   中英

無法在Linux中安裝Docker Compose

[英]Not able to install Docker compose in Linux

我無法在Linux系統上安裝docker compose。運行安裝命令后出現以下錯誤:

~$ sudo apt-get -f install docker-compose
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 code : Depends: libnotify4 but it is not going to be installed
        Depends: libnss3 but it is not going to be installed
        Depends: libxkbfile1 but it is not going to be installed
        Depends: libgconf-2-4 but it is not going to be installed
        Depends: libsecret-1-0 but it is not going to be installed
 docker-compose : Depends: python-cached-property but it is not going to be installed
                  Depends: python-docker (>= 1.9.0) but it is not going to be installed
                  Depends: python-dockerpty (>= 0.4.1) but it is not going to be installed
                  Depends: python-docopt but it is not going to be installed
                  Depends: python-enum34 but it is not going to be installed
                  Depends: python-jsonschema but it is not going to be installed
                  Depends: python-requests (>= 2.6.1) but it is not going to be installed
                  Depends: python-six (>= 1.3.0) but it is not going to be installed
                  Depends: python-texttable but it is not going to be installed
                  Depends: python-websocket but it is not going to be installed
                  Depends: python-yaml but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

有人可以幫我嗎? 我也嘗試過sudo apt-get clean但沒有用

我認為安裝docker-compose的最簡單方法是通過pip:

sudo apt-get install python-pip
sudo pip install docker-compose

在Linux系統上安裝Docker Compose
1.運行以下命令以下載最新版本的Docker Compose:

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

2.將可執行權限應用於二進制文件:

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

3.測試安裝。

$ docker-compose --version

有關更多詳細信息,請參閱docker手冊: https : //docs.docker.com/compose/install/

您好,您無法獲得依賴包。 也許您的系統很舊,並且不支持repozytory軟件包,例如在Wheezy中。 Mayby是其他問題。 我現在不知道,因為您尚未編寫有關所用系統的更多信息(例如,系統版本,存儲庫列表-cat /etc/apt/sources.list等)。 我建議您使用此官方教程在Docker官方頁面的Debian中安裝docker-compose-src: https : //docs.docker.com/compose/install/ (您可以使用curl下載最新的二進制docker-compose並使其適應使用,或使用pip工具安裝docker-compose-根據官方教程)或使用此頁面中提供的解決方案(例如pip工具)。 我使用了docker ofofial教程將docker-compose重新安裝到系統中(最新版本)。 很有幫助。 我使用Debian 9“ Stretch”(最新,穩定)。

PS。 使用其他解決方案安裝docker-compose時,請不要忘記刪除較舊的安裝docker-compose。

您不需要安裝docker compose。 它可以從dockerhub作為docker映像使用,...,因此您可以從docker運行它。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM