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

docker-compose docker: 'compose' is not a docker command #6569

Closed
1 of 3 tasks
morenoh149 opened this issue Nov 10, 2022 · 51 comments
Closed
1 of 3 tasks

docker-compose docker: 'compose' is not a docker command #6569

morenoh149 opened this issue Nov 10, 2022 · 51 comments

Comments

@morenoh149
Copy link

morenoh149 commented Nov 10, 2022

  • I have tried with the latest version of Docker Desktop
  • I have tried disabling enabled experimental features
  • I have uploaded Diagnostics
  • Diagnostics ID:

Expected behavior

Expected to be able to run compose.

Actual behavior

compose seems to load docker and docker cannot find compose.

Information

  • macOS Version: 12.3
  • Intel chip or Apple chip: Apple
  • Docker Desktop Version: 4.14.0,
  • compose: 2.12.2

Output of /Applications/Docker.app/Contents/MacOS/com.docker.diagnose check

% /Applications/Docker.app/Contents/MacOS/com.docker.diagnose check
Starting diagnostics

[PASS] DD0027: is there available disk space on the host?
[PASS] DD0028: is there available VM disk space?
[PASS] DD0018: does the host support virtualization?
[PASS] DD0001: is the application running?
[PASS] DD0017: can a VM be started?
[PASS] DD0016: is the LinuxKit VM running?
[PASS] DD0011: are the LinuxKit services running?
[PASS] DD0004: is the Docker engine running?
[PASS] DD0015: are the binary symlinks installed?
[PASS] DD0031: does the Docker API work?
[PASS] DD0013: is the $PATH ok?
[PASS] DD0003: is the Docker CLI working?
[PASS] DD0014: are the backend processes running?
[PASS] DD0007: is the backend responding?
[PASS] DD0008: is the native API responding?
[PASS] DD0009: is the vpnkit API responding?
[PASS] DD0010: is the Docker API proxy responding?
[PASS] DD0012: is the VM networking working?
[SKIP] DD0030: is the image access management authorized?
[PASS] DD0019: is the com.docker.vmnetd process responding?
[PASS] DD0033: does the host have Internet access?
[PASS] DD0018: does the host support virtualization?
[PASS] DD0001: is the application running?
[PASS] DD0017: can a VM be started?
[PASS] DD0016: is the LinuxKit VM running?
[PASS] DD0011: are the LinuxKit services running?
[PASS] DD0004: is the Docker engine running?
[PASS] DD0015: are the binary symlinks installed?
[PASS] DD0031: does the Docker API work?
[PASS] DD0032: do Docker networks overlap with host IPs?
No fatal errors detected.

Steps to reproduce the behavior

  1. This is a brand new company machine. I first installed the intel installer but then uninstalled and reinstalled with the apple silicon m1 installer.
  2. run docker-compose. get
% docker-compose
docker: 'compose' is not a docker command.
See 'docker --help'

the docker command seems to work but it cannot find the docker-compose command

I have these under bin

% ls -l /usr/local/bin
total 0
lrwxr-xr-x  1 root  wheel  62 Nov 10 16:48 com.docker.cli -> /Applications/Docker.app/Contents/Resources/bin/com.docker.cli
lrwxr-xr-x  1 root  wheel  54 Nov 10 16:48 docker -> /Applications/Docker.app/Contents/Resources/bin/docker
lrwxr-xr-x  1 root  wheel  62 Nov 10 16:48 docker-compose -> /Applications/Docker.app/Contents/Resources/bin/docker-compose
lrwxr-xr-x  1 root  wheel  80 Nov 10 16:48 docker-compose-v1 -> /Applications/Docker.app/Contents/Resources/bin/docker-compose-v1/docker-compose
lrwxr-xr-x  1 root  wheel  73 Nov 10 16:48 docker-credential-desktop -> /Applications/Docker.app/Contents/Resources/bin/docker-credential-desktop
lrwxr-xr-x  1 root  wheel  75 Nov 10 16:48 docker-credential-ecr-login -> /Applications/Docker.app/Contents/Resources/bin/docker-credential-ecr-login
lrwxr-xr-x  1 root  wheel  77 Nov 10 16:48 docker-credential-osxkeychain -> /Applications/Docker.app/Contents/Resources/bin/docker-credential-osxkeychain
lrwxr-xr-x  1 root  wheel  60 Nov 10 16:48 docker-index -> /Applications/Docker.app/Contents/Resources/bin/docker-index
lrwxr-xr-x  1 root  wheel  56 Nov 10 16:48 hub-tool -> /Applications/Docker.app/Contents/Resources/bin/hub-tool
lrwxr-xr-x  1 root  wheel  55 Nov 10 16:48 kubectl -> /Applications/Docker.app/Contents/Resources/bin/kubectl
lrwxr-xr-x  1 root  wheel  55 Nov 10 16:48 kubectl.docker -> /Applications/Docker.app/Contents/Resources/bin/kubectl
lrwxr-xr-x  1 root  wheel  65 Nov 10 16:48 vpnkit -> /Applications/Docker.app/Contents/Resources/bin/com.docker.vpnkit

running the compose command directly

 %  /Applications/Docker.app/Contents/Resources/bin/docker-compose  
docker: 'compose' is not a docker command.
See 'docker --help'
@srph
Copy link

srph commented Nov 11, 2022

Having the same issue here :(

@jare25
Copy link

jare25 commented Nov 11, 2022

Same issue here. macos 12.6.1 m1. docker 4.14.0

which docker-compose 
/usr/local/bin/docker-compose

@oieduardorabelo
Copy link

oieduardorabelo commented Nov 11, 2022

👍 Same issue here,

Settings:

  • macOS Ventura 13.0.1
  • MacBook Air Apple M2

I have tried:

  • Docker via .dmg downloaded from the website
  • Docker dmg installed via homebrew cask

Facing the same issues:
Screenshot 2022-11-12 at 12 03 53 AM

Screenshot 2022-11-12 at 12 03 44 AM


Output of /Applications/Docker.app/Contents/MacOS/com.docker.diagnose check

Screenshot 2022-11-12 at 12 10 42 AM

@john-wd
Copy link

john-wd commented Nov 11, 2022

Definitely something wrong with the latest release. I've downgraded to 4.13.1 and compose is working again.

@oieduardorabelo
Copy link

Definitely something wrong with the latest release. I've downgraded to 4.13.1 and compose is working again.

I can confirm that 4.13.1 is working for me as well. The issue appears on version 4.14.0 only.

@jare25
Copy link

jare25 commented Nov 11, 2022

docker-compose works for me if I switch off "Use docker compose v2". on 4.14.0

@abhn
Copy link

abhn commented Nov 11, 2022

docker-compose works for me if I switch off "Use docker compose v2". on 4.14.0

Can confirm this worked for me (M1 pro macbook on Ventura 13.0.1). Installing 4.13.1 didn't work for some reason (fresh install)

@swushi
Copy link

swushi commented Nov 11, 2022

docker-compose works for me if I switch off "Use docker compose v2". on 4.14.0

This does not do the trick for me, and neither does downgrading to 4.13.1.

On macOS Ventura 13.0 (Intel)

@nicks
Copy link

nicks commented Nov 11, 2022

Thanks for reporting. Sadly, I wasn't able to reproduce this issue on 4.14.0. Can somebody experiencing this issue upload a diagnostic, as documented here: https://docs.docker.com/desktop/troubleshoot/overview/#diagnose

@apsferreira
Copy link

hello guys, I was also getting the same error here, but I managed to get around it using the docker-compose-v1 command

docker-compose-v1 build

@mikeparker
Copy link
Contributor

Can you check contents of /usr/local/lib/docker/cli-plugins? (is docker-compose there?)

@apsferreira
Copy link

I don't have this folder here
my output is: ls: /usr/local/lib/docker/cli-plugins: No such file or directory

running the command: which docker-compose
I have this result: /usr/local/bin/docker-compose
running the command: ls /usr/local/bin/docker-compose
I have this result: docker-compose@ docker-compose-v1@

@mikeparker
Copy link
Contributor

Do you get the same error for docker buildx and docker scan and docker sbom?

@apsferreira
Copy link

yes i get the same error running these commands.

@mikeparker
Copy link
Contributor

Which version did you update from, or was this from a fresh install?

It's possible this is a consequence of updating from 4.13.1 to 4.14, would be good to narrow that down if anyone is seeing this error from updating from an older version than 4.13.1.

@skerbis
Copy link

skerbis commented Nov 11, 2022

i have it too. It's a fresh install not an update / upgrade
if I turn off v2 compose it works

@apsferreira
Copy link

i just installed docker desktop

  • Docker Desktop 4.14.0 (91374) is currently the newest version available.

@mikeparker
Copy link
Contributor

Great, thanks for quick feedback. I'm guessing theres likely an error in the installation log. If you can upload a diagnostic that'd be great. Sorry for the inconvenience.

@apsferreira
Copy link

I'm sorry but I don't have the installation log. what I can say is that I downloaded the latest version available from the website

@apsferreira
Copy link

Output of /Applications/Docker.app/Contents/MacOS/com.docker.diagnose check

[PASS] DD0027: is there available disk space on the host?
[PASS] DD0028: is there available VM disk space?
[PASS] DD0018: does the host support virtualization?
[PASS] DD0001: is the application running?
[PASS] DD0017: can a VM be started?
[PASS] DD0016: is the LinuxKit VM running?
[PASS] DD0011: are the LinuxKit services running?
[PASS] DD0004: is the Docker engine running?
[PASS] DD0015: are the binary symlinks installed?
[PASS] DD0031: does the Docker API work?
[PASS] DD0013: is the $PATH ok?
[PASS] DD0003: is the Docker CLI working?
[PASS] DD0014: are the backend processes running?
[PASS] DD0007: is the backend responding?
[PASS] DD0008: is the native API responding?
[PASS] DD0009: is the vpnkit API responding?
[PASS] DD0010: is the Docker API proxy responding?
[FAIL] DD0012: is the VM networking working? network checks failed: failed to ping host: exit status 1
[2022-11-11T21:35:58.917790000Z][com.docker.diagnose][I] ipc.NewClient: 990ce9f5-diagnose-network -> diagnosticd.sock diagnosticsd
[common/pkg/diagkit/gather/diagnose.runIsVMNetworkingOK()
[       common/pkg/diagkit/gather/diagnose/network.go:34 +0xc8
[common/pkg/diagkit/gather/diagnose.(*test).GetResult(0x103023c20)
[       common/pkg/diagkit/gather/diagnose/test.go:46 +0x40
[common/pkg/diagkit/gather/diagnose.Run.func1(0x103023c20)
[       common/pkg/diagkit/gather/diagnose/run.go:17 +0x40
[common/pkg/diagkit/gather/diagnose.walkOnce.func1(0x2?, 0x103023c20)
[       common/pkg/diagkit/gather/diagnose/run.go:142 +0x80
[common/pkg/diagkit/gather/diagnose.walkDepthFirst(0x1, 0x103023c20, 0x1400046f718)
[       common/pkg/diagkit/gather/diagnose/run.go:151 +0x88
[common/pkg/diagkit/gather/diagnose.walkDepthFirst(0x0, 0x103023da0, 0x1400046f718)
[       common/pkg/diagkit/gather/diagnose/run.go:148 +0x50
[common/pkg/diagkit/gather/diagnose.walkOnce(0x102afc4a0?, 0x1400059f890)
[       common/pkg/diagkit/gather/diagnose/run.go:137 +0x8c
[common/pkg/diagkit/gather/diagnose.Run(0x103023da0, 0x140001b4320?, {0x1400059fb08, 0x1, 0x1})
[       common/pkg/diagkit/gather/diagnose/run.go:16 +0x160
[main.checkCmd({0x140001b4010?, 0x6?, 0x4?}, {0x0, 0x0})
[       common/cmd/com.docker.diagnose/main.go:133 +0xdc
[main.main()
[       common/cmd/com.docker.diagnose/main.go:99 +0x30c
[2022-11-11T21:35:58.918377000Z][com.docker.diagnose][I] (56ebb988) 990ce9f5-diagnose-network C->S diagnosticsd POST /check-network-connectivity: {"ips":["192.168.1.9","100.127.100.1"]}
[2022-11-11T21:35:59.449086000Z][com.docker.diagnose][W] (56ebb988) 990ce9f5-diagnose-network C<-S 9179d285-diagnosticsd POST /check-network-connectivity (530.810541ms): failed to ping host: exit status 1

[SKIP] DD0030: is the image access management authorized?
[PASS] DD0019: is the com.docker.vmnetd process responding?
[PASS] DD0033: does the host have Internet access?
[PASS] DD0018: does the host support virtualization?
[PASS] DD0001: is the application running?
[PASS] DD0017: can a VM be started?
[PASS] DD0016: is the LinuxKit VM running?
[PASS] DD0011: are the LinuxKit services running?
[PASS] DD0004: is the Docker engine running?
[PASS] DD0015: are the binary symlinks installed?
[PASS] DD0031: does the Docker API work?
[PASS] DD0032: do Docker networks overlap with host IPs?

Please investigate the following 1 issue:

1 : The test: is the VM networking working?
    Failed with: network checks failed: failed to ping host: exit status 1

VM seems to have a network connectivity issue. Check your host firewall and anti-virus settings in case they are blocking the VM.

@kirandasika0
Copy link

Yea turning off docker compose v2 worked for me. Any idea what the new v2 compose does?

@mikeparker
Copy link
Contributor

mikeparker commented Nov 11, 2022

Looks like the fault could be a missing symlink between /usr/local/lib/docker/cli-plugins and /Applications/Docker.app/Contents/Resources/cli-plugins

Can you try manually creating this:

mkdir -p /usr/local/lib/docker
ln -s /Applications/Docker.app/Contents/Resources/cli-plugins /usr/local/lib/docker/cli-plugins

The commands may need to be run with sudo if /usr/local is owned by root.

@Aethon
Copy link

Aethon commented Nov 12, 2022

I was experiencing the same issue. The commands @mikeparker suggested fixed the issue. Thank you very much!

@ArinzeJeffrey-droid
Copy link

The commands @mikeparker shared fixed the issue for me as well. ❤️

@FranciscoJavierMartin
Copy link

Same issue here with MacBook Pro M1 Pro with Ventura 13.0.1. The commands @mikeparker suggested fixed the issue. Thanks a lot.

@Blackfaded
Copy link

The commands fixed it for me as well

@fabriziofs
Copy link

The commands fix the issue without having to turning off the docker compose v2 checkbox. Thanks @mikeparker!

@skerbis
Copy link

skerbis commented Nov 14, 2022

check

@dragutint
Copy link

Also works for me, thanks!

@masimo12358
Copy link

Works for me as well, thanks.

@rma1991
Copy link

rma1991 commented Nov 16, 2022

Thanks a lot, @mikeparker. Have been struggling with it for two days.

@carlthome
Copy link

Thanks @mikeparker! Crazy that this is needed when installing Docker Desktop on a fresh MBP.

@garymalcolm
Copy link

The solution by @mikeparker worked for me as well. Nicely done.

@ricardo-rossi
Copy link

Looks like Docker Desktop 4.14.1 (91661) fixed it for me

@mikeparker
Copy link
Contributor

We've now released 4.14.1 with the fix. Thanks everyone for helping track it down. Closing!

@dzagardo
Copy link

dzagardo commented Nov 17, 2022

still not fixed for me (after installing 4.14.1). was working 48 hours ago. broke yesterday evening yesterday afternoon during a presentation.

@dzagardo
Copy link

Screen Shot 2022-11-17 at 7 00 42 PM

@dzagardo
Copy link

interesting. shut down DD. deleted my .docker folder. booted up DD. it created a new .docker folder. compose is working now.

Screen Shot 2022-11-17 at 7 05 34 PM

@alexkirillovtech
Copy link

I updated my docker app to 4.14.1 (91661) and only after that issue is gone

@tholder
Copy link

tholder commented Nov 18, 2022

Confirm 4.14.1 is good.

@danshome
Copy link

@mikeparker This is not fixed. Not only that, docker compose is now busted as well.

/Applications/Docker.app/Contents/MacOS/com.docker.diagnose check

Starting diagnostics

[PASS] DD0027: is there available disk space on the host?

[PASS] DD0028: is there available VM disk space?

[PASS] DD0018: does the host support virtualization?

[PASS] DD0001: is the application running?

[PASS] DD0017: can a VM be started?

[PASS] DD0016: is the LinuxKit VM running?

[PASS] DD0011: are the LinuxKit services running?

[PASS] DD0004: is the Docker engine running?

[PASS] DD0015: are the binary symlinks installed?

[PASS] DD0031: does the Docker API work?

[PASS] DD0013: is the $PATH ok?

[PASS] DD0003: is the Docker CLI working?

[PASS] DD0014: are the backend processes running?

[PASS] DD0007: is the backend responding?

[PASS] DD0008: is the native API responding?

[PASS] DD0009: is the vpnkit API responding?

[PASS] DD0010: is the Docker API proxy responding?

[PASS] DD0012: is the VM networking working?

[SKIP] DD0030: is the image access management authorized?

[PASS] DD0019: is the com.docker.vmnetd process responding?

[PASS] DD0033: does the host have Internet access?

[PASS] DD0018: does the host support virtualization?

[PASS] DD0001: is the application running?

[PASS] DD0017: can a VM be started?

[PASS] DD0016: is the LinuxKit VM running?

[PASS] DD0011: are the LinuxKit services running?

[PASS] DD0004: is the Docker engine running?

[PASS] DD0015: are the binary symlinks installed?

[PASS] DD0031: does the Docker API work?

[PASS] DD0032: do Docker networks overlap with host IPs?

No fatal errors detected.

~ % docker compose

docker: 'compose' is not a docker command.

See 'docker --help'

~ % which docker

/usr/local/bin/docker

~ % ls -altr /usr/local/bin/docker

lrwxr-xr-x 1 dmclau admin 54 Nov 24 22:52 /usr/local/bin/docker -> /Applications/Docker.app/Contents/Resources/bin/docker

~ % docker compose

docker: 'compose' is not a docker command.

See 'docker --help'

~ % /Applications/Docker.app/Contents/Resources/bin/docker -v

Docker version 20.10.21, build baeda1f

~ % /Applications/Docker.app/Contents/Resources/bin/docker compose -f

unknown shorthand flag: 'f' in -f

It is clearly busted, and I just uninstalled and reinstalled it. I still had to manually create all of the symlinks to /usr/local/bin because Docker Desktop is not doing it like it use to in the past.

I manually had to create all of these symlinks or the diagnotics would fail...

lrwxr-xr-x 1 dmclau admin 54 Nov 24 22:52 docker -> /Applications/Docker.app/Contents/Resources/bin/docker

lrwxr-xr-x 1 dmclau admin 62 Nov 24 22:53 com.docker.cli -> /Applications/Docker.app/Contents/Resources/bin/com.docker.cli

lrwxr-xr-x 1 dmclau admin 62 Nov 24 22:54 docker-compose -> /Applications/Docker.app/Contents/Resources/bin/docker-compose

lrwxr-xr-x 1 dmclau admin 80 Nov 24 22:55 docker-compose-v1 -> /Applications/Docker.app/Contents/Resources/bin/docker-compose-v1/docker-compose

lrwxr-xr-x 1 dmclau admin 60 Nov 24 22:56 docker-index -> /Applications/Docker.app/Contents/Resources/bin/docker-index

lrwxr-xr-x 1 dmclau admin 73 Nov 24 22:56 docker-credential-desktop -> /Applications/Docker.app/Contents/Resources/bin/docker-credential-desktop

lrwxr-xr-x 1 dmclau admin 77 Nov 24 22:57 docker-credential-osxkeychain -> /Applications/Docker.app/Contents/Resources/bin/docker-credential-osxkeychain

lrwxr-xr-x 1 dmclau admin 75 Nov 24 22:58 docker-credential-ecr-login -> /Applications/Docker.app/Contents/Resources/bin/docker-credential-ecr-login

lrwxr-xr-x 1 dmclau admin 55 Nov 24 23:00 kubectl.docker -> /Applications/Docker.app/Contents/Resources/bin/kubectl

I think the reason that the symlinks aren't getting created is because the docker install command is busted.

/Applications/Docker.app/Contents/MacOS/install config

Error: accepts 1 arg(s), received 0

@danshome
Copy link

I was able to get docker compose working by doing the following...

mkdir -p /usr/local/lib/docker
ln -s /Applications/Docker.app/Contents/Resources/cli-plugins /usr/local/lib/docker/cli-plugins

You guys have got to figure out the Docker install problems on Mac OS. This has been going on for over 6 months now, it seems like every time there is a patch to MacOS I end up spending days trying to get Docker working again. The symlink issue has been an issue for some time now, and it's everyone on my team that is having the issues, as well as hundreds of hits on the google searches. This is a real problem and it needs to be investigated and fixed. If I can manually create all the symlinks with my user, then so should the Docker install command, and it doesn't. If you want to send me a debug build I'd be happy to run it to tell you why it's silently failing.

@mat007
Copy link
Member

mat007 commented Nov 25, 2022

@danshome if you’re still having problems with the symlinks after updating to 1.14.1, could you create a new issue?

@kitkars
Copy link

kitkars commented Dec 11, 2022

Facing this issue with 4.15.0.
Poor testing

@lukemiller
Copy link

FWIW - I had this issue after moving to a new M1 Macbook. I had a corrupted /usr/local/lib/docker/cli-plugins directory. After deleting that and the stuff in usr/local/bin, I reinstalled Docker and docker compose worked again.

@ggergo
Copy link

ggergo commented Dec 22, 2022

With M1 mac mini I installed docker to an external ssd, and did set the disk image location to the same external ssd. After I faced this error, I installed the latest update (4.15.0), restarted the operating system, and the error went away.

@tlightsky
Copy link

Facing this issue with 4.15.0. Poor testing

same, Poor testing

@tlightsky
Copy link

I was able to get docker compose working by doing the following...

mkdir -p /usr/local/lib/docker ln -s /Applications/Docker.app/Contents/Resources/cli-plugins /usr/local/lib/docker/cli-plugins

You guys have got to figure out the Docker install problems on Mac OS. This has been going on for over 6 months now, it seems like every time there is a patch to MacOS I end up spending days trying to get Docker working again. The symlink issue has been an issue for some time now, and it's everyone on my team that is having the issues, as well as hundreds of hits on the google searches. This is a real problem and it needs to be investigated and fixed. If I can manually create all the symlinks with my user, then so should the Docker install command, and it doesn't. If you want to send me a debug build I'd be happy to run it to tell you why it's silently failing.

this with sudo works for me

@lambomc
Copy link

lambomc commented Jan 24, 2023

I use a Macbook Air (M1 chip) and the docker compose didn't work for me in the latest version of docker (4.16.2), so I downgraded to the v4.13.1, toggled the “Use Docker Compose V2” in the general tab, and ran "docker-compose-v1 build --force-rm" in the terminal . It finally worked

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

/lifecycle locked

@docker docker locked and limited conversation to collaborators Mar 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests