Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/usr/local/bin/docker-compose: line 1: Not: command not found #6268

Closed
smelike opened this issue Oct 12, 2018 · 48 comments
Closed

/usr/local/bin/docker-compose: line 1: Not: command not found #6268

smelike opened this issue Oct 12, 2018 · 48 comments

Comments

@smelike
Copy link

smelike commented Oct 12, 2018

Execute the command

[root@localhost ~]# curl -L https://github.com/docker/compose/releases/download/1.23.0-rc2/docker-compose-`uname -s-uname -m` -o /usr/local/bin/docker-compose
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 9 0 9 0 0 21 0 --:--:-- --:--:-- --:--:-- 61

Context information (for bug reports)

[root@localhost ~]# ll /usr/local/bin/
total 20964
-rwxr-xr-x 1 root root 9 Oct 12 00:16 docker-compose
-rwxr-xr-x 1 root root 4839 Aug 3 14:10 erb
-rwxr-xr-x 1 root root 548 Aug 3 14:10 gem
-rwxr-xr-x 1 root root 192 Aug 3 14:10 irb
-rwxr-xr-x 1 root root 589 Aug 3 14:10 rake
-rwxr-xr-x 1 root root 940 Aug 3 14:10 rdoc
-rwxr-xr-x 1 root root 190 Aug 3 14:10 ri
-rwxr-xr-x 1 root root 21432601 Aug 3 14:04 ruby

Output of "docker-compose version"

[root@localhost ~]# /usr/local/bin/docker-compose --version
/usr/local/bin/docker-compose: line 1: Not: command not found

Output of "docker version"

[root@localhost ~]# docker --version
docker - version 1.5
Copyright 2003, Ben Jansens ben@orodu.net

Usage: docker [OPTIONS]

Options:
-help Show this help.
-display DISLPAY The X display to connect to.
-border The width of the border to put around the
system tray icons. Defaults to 1.
-vertical Line up the icons vertically. Defaults to
horizontally.
-wmaker WindowMaker mode. This makes docker a
fixed size (64x64) to appear nicely in
in WindowMaker.
Note: In this mode, you have a fixed
number of icons that docker can hold.
-iconsize SIZE The size (width and height) to display
icons as in the system tray. Defaults to

Output of "docker-compose config"

[root@localhost ~]# docker-compose config
/usr/local/bin/docker-compose: line 1: Not: command not found

@shin-
Copy link

shin- commented Oct 12, 2018

Hi,

In the future please fill out the issue template properly, as this is painful to read through.
You can obviously see that the file size for docker-compose is wrong here - there's no way an executable would be 9 bytes in length. This is probably due to the fact that you're on an unsupported OS or architecture, but since you neglected to provide that information, I can't say for sure.

@shin- shin- closed this as completed Oct 12, 2018
@samuraii
Copy link

There is no info about if OS is supported or unsupported, so this is bug for sure.

@ailuropoda0
Copy link

ailuropoda0 commented Jun 3, 2019

If you open the '/usr/local/bin/docker-compose' file, it would be definitely 'Not Found'.(9 bytes)
Your kernel or machine may not be supported.

@raksshet
Copy link

use this should work.

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

@semmersultan
Copy link

thanks @raksshet its worked

@mlsmrc
Copy link

mlsmrc commented Aug 26, 2019

I have a same bug with the 1.24.0 version on Raspbian.

@samuelbacaner
Copy link

I also have the same problem with 1.24.1 on Raspian.

@Rampelflik
Copy link

Same issue on Rock64 ubuntu bionic....
The docker-compose file is located in /usr/local/bin but the file is empty.
Now what?

@mogranjm
Copy link

mogranjm commented Oct 3, 2019

@mlsmrc

I have a same bug with the 1.24.0 version on Raspbian.

@samuelbacaner

I also have the same problem with 1.24.1 on Raspian.

Isn't Raspbian a 32 bit OS? The official docs state you can only run compose on 64 bit Linux.

So when you try to curl with $(uname -m) in the url path it won't populate with x86_64, so you're probably trying to access a release that doesn't exist.

@mogranjm
Copy link

mogranjm commented Oct 3, 2019

@Rampelflik are you sure you're trying to access a real release? Check the output of $(uname -s)and $(uname -m) to make sure curl is trying to access the Linux-x86_64 release.

(If $(uname -m) outputs something other than x86_64, your OS is probably unsupported).

If that's working, check that the release you're trying to access actually exists here.

As @raksshet stated above, your curl call should look like this (or similar):
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

@aodr3w
Copy link

aodr3w commented Jan 20, 2020

I figured out the problem , for me it was caused by the fact that was trying to download version 1.25.2-rc1 which is not available for some reason. SO i downgraded to 1.24.0 and it worked.

@ericslandry
Copy link

@AndrewOdiit you forgot the "v" introduced in tag "v1.25.2"

@lgrosz
Copy link

lgrosz commented Jul 8, 2020

For those trying to install on Raspbian (ARM64) or another unsupported architecture, you can install docker-compose via pip.

@venkat44488
Copy link

venkat44488 commented Aug 19, 2020

I am trying to install docker-compose on redhat 7 of ppc64le(Power9 server) arch type still getting same error.
curl command gives below output , seems it has downloaded 9B.

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9 100 9 0 0 25 0 --:--:-- --:--:-- --:--:-- 25

Thanks
venkat.

@ADI10HERO
Copy link

I am facing the same error

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

Output of uname -s : Linux
Output of uname -m : i686

@mogranjm
Copy link

mogranjm commented Aug 24, 2020

@ADI10HERO 32 bit architectures are not supported (you're using i686), you need to be running a 64 bit processor and OS (i.e. uname -m must return x86_64) to install docker-compose this way. You might want to try installing via pip as suggested above.

For those trying to install on Raspbian (ARM64) or another unsupported architecture, you can install docker-compose via pip.

See https://github.com/docker/compose/releases/1.26.2 for downloads available in the latest release (note there's no docker-compose-Linux-i686)

@rodrigoreis
Copy link

rodrigoreis commented Oct 19, 2020

you all folks are downloading a "Not Found" string returned by a 404 http status code. Your target file for target architecture doesn't exist.

/usr/local/bin/docker-compose: line 1: Not: command not found

the Not above is realated to what I've explained.

did you guys tried to run nano /usr/local/bin/docker-compose ?

@specialistvlad
Copy link

Who trying to install docker compose on raspbian use this guide
https://withblue.ink/2020/06/24/docker-and-docker-compose-on-raspberry-pi-os.html

@stepri
Copy link

stepri commented May 14, 2021

sudo apt update
sudo apt install -y python3-pip libffi-dev
sudo pip3 install docker-compose

@stepthevir2
Copy link

stepthevir2 commented Jun 23, 2021

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

then
sudo pip install docker-compose

then
docker-compose --version

This work for me

@intellent
Copy link

sudo pip3 install docker-compose worked for me on Raspberry Pi OS Lite.

@spandan12
Copy link

I got a similar problem. It was because the version I tried to install was not actually there. So before downloading the docker-compose, make sure the release version exists from the link below:
https://docs.docker.com/compose/release-notes/

@gandimohammad
Copy link

Type these commands in order

$ sudo apt install docker-compose
$ docker-compose version
$ sudo wget –O /usr/local/bin/docker-compose https://github.com/docker/compose/releases/download/1.25.0/docker-compose-Linux-x86_64
$ sudo chmod +x /usr/local/bin/docker-compose
$ docker-compose --version
$ sudo rm /usr/local/bin/docker-compose
$ ./docker.sh install

@bellaj
Copy link

bellaj commented Sep 30, 2021

I ve got this error when trying to run docker-compose in travis. I solved the issue using :

sudo curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

@hershkoy
Copy link

hershkoy commented Nov 16, 2021

@Rampelflik are you sure you're trying to access a real release? Check the output of $(uname -s)and $(uname -m) to make sure curl is trying to access the Linux-x86_64 release.

(If $(uname -m) outputs something other than x86_64, your OS is probably unsupported).

If that's working, check that the release you're trying to access actually exists here.

As @raksshet stated above, your curl call should look like this (or similar): sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

@ADI10HERO answer is correct, but notice that there have been a change in the link on github, and now the version number should look like v2.1.1 (not 2.1.1, i.e. include the v in the link)
This is the link that worked for me:

sudo curl -L "https://github.com/docker/compose/releases/download/v2.1.1/docker-compose-linux-x86_64" -o /usr/local/bin/docker-compose

@sn3h
Copy link

sn3h commented Nov 17, 2021

sudo curl -L "https://github.com/docker/compose/releases/download/v2.1.1/docker-compose-linux-x86_64" -o /usr/local/bin/docker-compose

love you, this works

@nikelborm
Copy link

nikelborm commented Nov 17, 2021

I found that uname -s returns Linux with upper-case L, but the release binary on Github contains lower-case l inside its name.

nikel@nikel-PC:~/odm-payless/backend$ echo https://github.com/docker/compose/releases/download/2.1.1/docker-compose-`uname -s`-`uname -m`
https://github.com/docker/compose/releases/download/2.1.1/docker-compose-Linux-x86_64

@Mussabaheen
Copy link

if you are using macOS than first enter this command
sudo rm /usr/local/bin/docker-compose
to remove docker-compose installed through curl
than install it using
brew install docker-compose

@DonRichards
Copy link

To install or upgrade to the latest version every time for MAC (and will likely work for linux as well).

sudo curl -L "https://github.com/docker/compose/releases/download/$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep '\"tag_name\":' | sed -E 's/.*\"([^\"]+)\".*/\1/')/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

This will fetch the latest version number and use that to download the latest and install it.

@shaahrokh
Copy link

shaahrokh commented Dec 10, 2021

Introduced from version 1.25.2:
Preface a "v" before the version number you want in the link as below and the command executes successfully:

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

SabNK added a commit to SabNK/docker.github.io that referenced this issue Jan 8, 2022
docker/compose#6268 (comment)
"v" introduced in tag "v1.25.2"
@Histocompitability
Copy link

Histocompitability commented Jan 15, 2022

@raksshet - man, thank you so much, you literally saved my day!)

@tunna-7
Copy link

tunna-7 commented Jan 18, 2022

@raksshet Man, fr Thank You So Much!.....Been trying to solve that problem since 2 days😭💪

@StepanGavrilov
Copy link

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

Saved my life, thanks bro!

@ELMRABET-Abdelali
Copy link

this is working, thank you.

@Drewberrysteph
Copy link

Issue solve on mac m1 after running
docker run -d -p 80:80 docker/getting-started

You should have docker installed

@liuyuf
Copy link

liuyuf commented Sep 2, 2022

To install or upgrade to the latest version every time for MAC (and will likely work for linux as well).

sudo curl -L "https://github.com/docker/compose/releases/download/$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep '\"tag_name\":' | sed -E 's/.*\"([^\"]+)\".*/\1/')/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

This will fetch the latest version number and use that to download the latest and install it.

That helped me

@jd-apprentice
Copy link

use this should work.

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

Thank you so much! this worked for me <3

@Abdurahman-hassan
Copy link

you should follow this link in order to solve your issue:

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

you forget the v before the version thank you @AndrewOdiit also and when you inquire on version you should write: docker-compose version

@DutchKevv
Copy link

DutchKevv commented Sep 24, 2022

@Abdurahman-hassan

Its silly, but yeah... I also forgot the 'v' in front of the version number

Old tutorials (< v2) don't use the 'v' in the URL, so easy to overlook.

Thanks

@Imomov
Copy link

Imomov commented Oct 6, 2022

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

@emaguero
Copy link

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

then sudo pip install docker-compose

then docker-compose --version

This work for me

Hi, only for said that this task works...
emi@nbdebian11:/usr/local/bin$
emi@nbdebian11:/usr/local/bin$ sudo docker-compose --version
docker-compose version 1.29.2, build unknown

I don't know build unknown mean.
regards

@hohodsj
Copy link

hohodsj commented Dec 25, 2022

I had the same issue when I try to setup on the Oracle-Linux-8.6-aarch64-2022.12.15-0 image. You can get more information here https://github.com/linuxserver/docker-docker-compose
And here's what I did
sudo curl -L --fail https://raw.githubusercontent.com/linuxserver/docker-docker-compose/master/run.sh -o /usr/local/bin/docker-compose

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

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

@bantustic
Copy link

bantustic commented Mar 1, 2023

sudo curl -L "https://github.com/docker/compose/releases/download/$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep '\"tag_name\":' | sed -E 's/.*\"([^\"]+)\".*/\1/')/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

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

DonRichard's solution as seen above here and further above on the page is the best solution here. Have only added the line for docker-compose to be executable. You get an uptodate version of docker-compose, and it also solves the issue:
/usr/local/bin/docker-compose: line 1: Not: command not found

Using linux but like he said its most likely to work on a Mac.

@marquitobb
Copy link

this is working on my raspberry with command: sudo pip3 install docker-compose==1.28.6

@TuanMinPay
Copy link

thanks, worked for me

@leesonaa
Copy link

  • get the file from "https://github.com/docker/compose/releases"
  • then copy docker-compose-xxx-xxx to /usr/local/bin and renamed it to docker-compose and "chmod +x docker-compose"
  • try command "docker-compose -v "
    well , it worked .

@kaye-alvarado
Copy link

Thank you for this. Been trying to resolve it for >4hrs

@Q0011er
Copy link

Q0011er commented Apr 16, 2024

sudo curl -L "https://github.com/docker/compose/releases/download/$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep '\"tag_name\":' | sed -E 's/.*\"([^\"]+)\".*/\1/')/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

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

DonRichard's solution as seen above here and further above on the page is the best solution here. Have only added the line for docker-compose to be executable. You get an uptodate version of docker-compose, and it also solves the issue: /usr/local/bin/docker-compose: line 1: Not: command not found

Using linux but like he said its most likely to work on a Mac.

Work for me, thnx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests