sudo: docker-compose: command not found

前端 未结 7 2206
梦谈多话
梦谈多话 2020-12-25 09:56

I am trying to run docker-compose using sudo.

I have both docker and docker-compose installed on Ubuntu 16.01.

Due to an error while trying to download compo

7条回答
  •  旧时难觅i
    2020-12-25 10:17

    The output of dpkg -s ... demonstrates that docker-compose is not installed from a package. Without more information from you there are at least two possibilities:

    1. docker-compose simply isn't installed at all, and you need to install it.

      The solution here is simple: install docker-compose.

    2. docker-compose is installed in your $HOME directory (or other location not on root's $PATH).

      There are several solution in this case. The easiest is probably to replace:

      sudo docker-compose ...
      

      With:

      sudo `which docker-compose` ...
      

      This will call sudo with the full path to docker-compose.

      You could alternatively install docker-compose into a system-wide directory, such as /usr/local/bin.

提交回复
热议问题