Docker-compose command not found

Hi ,

I followed as mentioned in video , but i am getting command not found with docker-compose 

[user@anvesh12031 Dockerfiles]$ cat docker-compose.yml

version: '3'



image: myhttpd:v1

build: .


- "81:80"


image: myhttpd:v1


- "82:80"


image: nginx:latest


- "80:80"

[user@anvesh12031 Dockerfiles]$ docker-compose up -d

-bash: docker-compose: command not found

[user@anvesh12031 Dockerfiles]$ ll

total 8

-rwxr-xr-x. 1 user user 222 Jan 6 21:23 docker-compose.yml

-rwxr-xr-x. 1 user user 200 Jan 5 16:57 Dockerfile

[user@anvesh12031 Dockerfiles]$ docker-compse.yml up -d

-bash: docker-compse.yml: command not found

[user@anvesh12031 Dockerfiles]$ docker-

docker-init docker-proxy

  • post-author-pic
    Terrence C

    Looks like Docker Compose is not installed (or at least, not in the path). If you execute 'which docker-compose', do you get a path/location back for the command? Also, you cannot execute the yaml file itself, I see you also try to do a 'docker-compose.yml up -d', the yaml file won't execute, it simply contains the tasks you want Docker Compose to do.

  • post-author-pic
    Anvesh M

    [user@anvesh12031 ~]$ which docker-compose

    /usr/bin/which: no docker-compose in (/usr/local/rvm/gems/ruby-2.4.1/bin:/usr/local/rvm/gems/ruby-2.4.1@global/bin:/usr/local/rvm/rubies/ruby-2.4.1/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/usr/local/rvm/bin:/home/user/.local/bin:/home/user/bin)

    [user@anvesh12031 ~]$ pip list | grep docker-compose

    [user@anvesh12031 ~]$ yum list | grep docker-compose

    docker-compose.noarch 1.18.0-2.el7 epel

    [user@anvesh12031 ~]$ sudo pip install docker-compose

    [sudo] password for user:

    Collecting docker-compose

    Using cached

    Requirement already satisfied: PyYAML<4,>=3.10 in /usr/lib64/python2.7/site-packages (from docker-compose) (3.10)

    Collecting docker<4.0,>=3.6.0 (from docker-compose)

    Using cached

    Requirement already satisfied: backports.ssl-match-hostname>=3.5; python_version < "3.5" in /usr/lib/python2.7/site-packages (from docker-compose) (

    Collecting requests!=2.11.0,!=2.12.2,!=2.18.0,<2.21,>=2.6.1 (from docker-compose)

    Using cached



    Requirement already satisfied: six<2,>=1.3.0 in /usr/lib/python2.7/site-packages (from docker-compose) (1.9.0)

    Requirement already satisfied: enum34<2,>=1.0.4; python_version < "3.4" in /usr/lib/python2.7/site-packages (from docker-compose) (1.0.4)

    Collecting texttable<0.10,>=0.9.0 (from docker-compose)

    Using cached

    Collecting dockerpty<0.5,>=0.4.1 (from docker-compose)

    Using cached

    Requirement already satisfied: ipaddress>=1.0.16; python_version < "3.3" in /usr/lib/python2.7/site-packages (from docker-compose) (1.0.16)

    Requirement already satisfied: websocket-client<1.0,>=0.32.0 in /usr/lib/python2.7/site-packages (from docker-compose) (0.54.0)

    Collecting docopt<0.7,>=0.6.1 (from docker-compose)

    Using cached

    Collecting jsonschema<3,>=2.5.1 (from docker-compose)

    Using cached


    Collecting cached-property<2,>=1.2.0 (from docker-compose)

    Using cached


    Requirement already satisfied: docker-pycreds>=0.3.0 in /usr/lib/python2.7/site-packages (from docker<4.0,>=3.6.0->docker-compose) (0.4.0)

    Requirement already satisfied: idna<2.8,>=2.5 in /usr/lib/python2.7/site-packages (from requests!=2.11.0,!=2.12.2,!=2.18.0,<2.21,>=2.6.1->docker-compose)


    Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/lib/python2.7/site-packages (from requests!=2.11.0,!=2.12.2,!=2.18.0,<2.21,>=2.6.1->docker-c

    ompose) (3.0.4)

    Requirement already satisfied: urllib3<1.25,>=1.21.1 in /usr/lib/python2.7/site-packages (from requests!=2.11.0,!=2.12.2,!=2.18.0,<2.21,>=2.6.1->docker-c

    ompose) (1.24.1)

    Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python2.7/site-packages (from requests!=2.11.0,!=2.12.2,!=2.18.0,<2.21,>=2.6.1->docker-comp

    ose) (2018.11.29)

    Collecting functools32; python_version == "2.7" (from jsonschema<3,>=2.5.1->docker-compose)

    Using cached

    Installing collected packages: requests, docker, texttable, dockerpty, docopt, functools32, jsonschema, cached-property, docker-compose

    Found existing installation: requests 2.6.0

    Cannot uninstall 'requests'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to onl

    y a partial uninstall.

  • post-author-pic
    Terrence C

    Sometimes relying on Python to manage or know about other dependencies can cause confusion. Try installing directly from Docker using the instructions on their site, you can find that information here (you download and install a pre-written shell script from Docker).

Looking For Team Training?

Learn More