for-mac icon indicating copy to clipboard operation
for-mac copied to clipboard

docker: 'compose' is not a docker command.

Open mila opened this issue 4 years ago • 21 comments

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

I cannot upload diagnostics, I run into #6234.

Expected behavior

$ docker-compose --version
$ docker compose --version

Outputs Docker Compose version.

Actual behavior

$ docker-compose --version
docker: 'compose' is not a docker command.
See 'docker --help'

$ docker compose
docker: 'compose' is not a docker command.
See 'docker --help'

Information

  • macOS Version: Monterey 12.3 (21E230)
  • Intel chip or Apple chip: Apple
  • Docker Desktop Version: 4.6.0 (75818) (Engine: 20.10.13, Compose: v2.3.3)

I installed the latest Docker Desktop for Mac to a new MacBook with an Apple chip. Everything works smoothly, but I am not able use the new docker compose subcommand. docker-compose works normally.

When I enabled "Use Docker Compose V2" in Dashboard Preferences, docker-compose returns same error as docker compose. I can still use docker-compose-v1.

I tried to reinstall Docker Desktop and restart it into factory settings, it did not help.

Output of /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] DD0031: does the Docker API work?
[PASS] DD0004: is the Docker engine running?
[PASS] DD0011: are the LinuxKit services running?
[FAIL] DD0016: is the LinuxKit VM running? vm is not running: vm has not started
[PASS] DD0001: is the application running?
[PASS] DD0018: does the host support virtualization?
[FAIL] DD0017: can a VM be started? vm has not started: vm has not started
[PASS] DD0015: are the binary symlinks installed?
[PASS] DD0003: is the Docker CLI working?
[PASS] DD0013: is the $PATH ok?
[PASS] DD0007: is the backend responding?
[PASS] DD0014: are the backend processes running?
[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-03-17T13:15:20.685962000Z][com.docker.diagnose][I] ipc.NewClient: 160ba9f6-diagnose-network -> Library/Containers/com.docker.docker/Data/diagnosticd.sock diagnosticsd
[common/pkg/diagkit/gather/diagnose.runIsVMNetworkingOK()
[	common/pkg/diagkit/gather/diagnose/network.go:34 +0x130
[common/pkg/diagkit/gather/diagnose.(*test).GetResult(0x103bfcc20)
[	common/pkg/diagkit/gather/diagnose/test.go:46 +0x44
[common/pkg/diagkit/gather/diagnose.Run.func1(0x103bfcc20)
[	common/pkg/diagkit/gather/diagnose/run.go:17 +0x48
[common/pkg/diagkit/gather/diagnose.walkOnce.func1(0x1, 0x103bfcc20)
[	common/pkg/diagkit/gather/diagnose/run.go:140 +0xa0
[common/pkg/diagkit/gather/diagnose.walkDepthFirst(0x1, 0x103bfcc20, 0x1400026b818)
[	common/pkg/diagkit/gather/diagnose/run.go:146 +0x40
[common/pkg/diagkit/gather/diagnose.walkDepthFirst(0x0, 0x103bfcaa0, 0x1400026b818)
[	common/pkg/diagkit/gather/diagnose/run.go:149 +0x80
[common/pkg/diagkit/gather/diagnose.walkOnce(0x103bfcaa0, 0x1400035f960)
[	common/pkg/diagkit/gather/diagnose/run.go:135 +0x90
[common/pkg/diagkit/gather/diagnose.Run(0x103bfcaa0, 0x103bfcda0, {0x1400035fad8, 0x1, 0x1})
[	common/pkg/diagkit/gather/diagnose/run.go:16 +0x188
[main.checkCmd({0x14000032050, 0x0, 0x0}, {0x0, 0x0})
[	common/cmd/com.docker.diagnose/main.go:131 +0x114
[main.main()
[	common/cmd/com.docker.diagnose/main.go:97 +0x378
[2022-03-17T13:15:20.686062000Z][com.docker.diagnose][I] (7420ea29) 160ba9f6-diagnose-network C->S diagnosticsd POST /check-network-connectivity: {"ips":["172.30.163.41","100.64.0.1","172.29.21.45"]}
[2022-03-17T13:15:21.209663000Z][com.docker.diagnose][E] (7420ea29) 160ba9f6-diagnose-network C<-S 6b213a3c-diagnosticsd POST /check-network-connectivity (523.626ms): failed to ping host: exit status 1
[common/pkg/diagkit/gather/diagnose.runIsVMNetworkingOK()
[	common/pkg/diagkit/gather/diagnose/network.go:35 +0x1bc
[common/pkg/diagkit/gather/diagnose.(*test).GetResult(0x103bfcc20)
[	common/pkg/diagkit/gather/diagnose/test.go:46 +0x44
[common/pkg/diagkit/gather/diagnose.Run.func1(0x103bfcc20)
[	common/pkg/diagkit/gather/diagnose/run.go:17 +0x48
[common/pkg/diagkit/gather/diagnose.walkOnce.func1(0x1, 0x103bfcc20)
[	common/pkg/diagkit/gather/diagnose/run.go:140 +0xa0
[common/pkg/diagkit/gather/diagnose.walkDepthFirst(0x1, 0x103bfcc20, 0x1400026b818)
[	common/pkg/diagkit/gather/diagnose/run.go:146 +0x40
[common/pkg/diagkit/gather/diagnose.walkDepthFirst(0x0, 0x103bfcaa0, 0x1400026b818)
[	common/pkg/diagkit/gather/diagnose/run.go:149 +0x80
[common/pkg/diagkit/gather/diagnose.walkOnce(0x103bfcaa0, 0x1400035f960)
[	common/pkg/diagkit/gather/diagnose/run.go:135 +0x90
[common/pkg/diagkit/gather/diagnose.Run(0x103bfcaa0, 0x103bfcda0, {0x1400035fad8, 0x1, 0x1})
[	common/pkg/diagkit/gather/diagnose/run.go:16 +0x188
[main.checkCmd({0x14000032050, 0x0, 0x0}, {0x0, 0x0})
[	common/cmd/com.docker.diagnose/main.go:131 +0x114
[main.main()
[	common/cmd/com.docker.diagnose/main.go:97 +0x378

[PASS] DD0032: do Docker networks overlap with host IPs?
[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?

Please investigate the following 1 issue:

1 : The test: can a VM be started?
    Failed with: vm has not started: vm has not started

The Docker engine runs inside a Linux VM. Therefore we must be able to start Virtual Machines.

I don't understand to the error reported because I can run Docker images without any problems if I avoid Docker Compose.

mila avatar Mar 17 '22 13:03 mila

Is there an ETA on fixing this issue?

sureshms avatar Apr 29 '22 00:04 sureshms

Issues go stale after 90 days of inactivity. Mark the issue as fresh with /remove-lifecycle stale comment. Stale issues will be closed after an additional 30 days of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale

docker-robott avatar Jul 28 '22 01:07 docker-robott

/remove-lifecycle stale

mila avatar Jul 28 '22 12:07 mila

macOS Version: Monterey 12.6 Intel chip or Apple chip: Apple M1 Pro Docker Desktop Version: 4.12.0 (85629) (Engine: 20.10.17, Compose: v2.10.2)

I'm experiencing the same issue after upgrading. After the Docker Desktop update, I cannot use docker-compose or docker compose. I can uncheck "Use Docker Compose V2" in settings and have docker-compose work, but I cannot use docker compose. I'll also mention that "Apply & Restart" fails to work and I must manually stop it also. I've tried reinstalling and I've also cleared out all docker related entries in /usr/local/bin without success.

jamesottinger avatar Sep 23 '22 13:09 jamesottinger

@jamesottinger did you find a fix?

Michael-kyalo avatar Oct 13 '22 17:10 Michael-kyalo

With Docker Desktop 4.12.0 (85629) everything works as expected.

mila avatar Oct 17 '22 07:10 mila

Unfortunately I have this issue even running the latest (4.13.1) Docker Desktop

eli-rich avatar Nov 03 '22 19:11 eli-rich

I've had to use sudo docker compose with the latest releases. Using sudo wasn't required prior when using docker-compose, in my case anyway.

jamesottinger avatar Nov 03 '22 20:11 jamesottinger

using sudo gives the same error. Its not a permissions issue for me, sounds like a path issue. I'm running osx 12.3 docker desktop 4.14.0 apple silicon

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

I have installed using the apple silicon desktop dmg.

morenoh149 avatar Nov 10 '22 20:11 morenoh149

@morenoh149 I have exactly same issue in OSX 12.5 and the same docker desktop version

valentinrougier39 avatar Nov 10 '22 21:11 valentinrougier39

Same for me with latest (4.14.0 (91374)) version.

albedoweb avatar Nov 11 '22 01:11 albedoweb

so do I. The same issue as above. I installed docker-desktop version 4.14.0(91374), and I can't execute docker-compose. The workaround I did was install the docker-compose using brew, but I need to call docker-compose instead of docker compose. It works now, but I changed my script to accommodate this temporary solution. It would be nice if we got a fix for that.

zuchi avatar Nov 11 '22 01:11 zuchi

Having the same issue on a fresh mac (apple cpu), OSX 12.5 and Docker 4.14.0

Blackfaded avatar Nov 11 '22 07:11 Blackfaded

Having the same issue as @Blackfaded , fresh mac Ventura 13 and Docker 4.14.0(91374)

reichie020212 avatar Nov 11 '22 07:11 reichie020212

Same issue here with Ventura 13.0.1 and Docker 4.14.0 (91374).

[) docker compose
docker: 'compose' is not a docker command.
See 'docker --help'

[) docker- compose
docker: 'compose' is not a docker command.
See 'docker --help'

[) docker --version
Docker version 20.10.21, build baedalf

alioguzhan avatar Nov 11 '22 09:11 alioguzhan

The same issue, and I tried version 4 and version 3. Apple M1 Pro

EdwardWang-ToT avatar Nov 11 '22 09:11 EdwardWang-ToT

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

jare25 avatar Nov 11 '22 12:11 jare25

@mila please re-open, still an issue on 4.14.0.

Unfortunately, toggling off Use Docker Compose V2 didn't do the trick for me.

MacOS Ventura 13.0 (Intel)
Docker Desktop 4.14.0 (91374)

% which docker
/usr/local/bin/docker
% which docker-compose
/usr/local/bin/docker-compose
% docker compose
docker: 'compose' is not a docker command.
See 'docker --help'
% docker-compose
docker: 'compose' is not a docker command.
See 'docker --help'
% docker --version
Docker version 20.10.21, build baeda1f

swushi avatar Nov 11 '22 16:11 swushi

MacBook M1 pro Mac OS Monterey 12.6.1 Docker Desktop 4.14.0 (91374)

% docker compose
docker: 'compose' is not a docker command.
See 'docker --help'
% docker-compose
docker: 'compose' is not a docker command.
See 'docker --help'
% docker --version
Docker version 20.10.21, build baeda1f

Switching off "use Docker compose v2" allowed me to use docker-compose as a work around

Installed Docker desktop last week and docker compose worked perfectly on an almost identical computer. unfortunately I do not know the versions installed because that computer was swapped out hence I am setting this one up.

ramseylove avatar Nov 11 '22 17:11 ramseylove

Sorry to hear you're having trouble. I'm going to lock this issue because it seems like the new comments are related to DD 4.14, not the original issue filed here. There's a separate bug tracking this: https://github.com/docker/for-mac/issues/6569

If you're having problems with Compose in DD 4.14, please post a diagnostic ID on that issue so we can investigate. Thanks!

nicks avatar Nov 11 '22 20:11 nicks