"docker: 'compose' is not a docker command" when running docker compose - docker

After installing the latest version of Docker Desktop on my M1 Mac pro, I can't seem to run docker compose despite having all the correct files installed.
I've tried running docker-compose and docker compose in my terminal and I get this message: docker: 'compose' is not a docker command.
After running docker --version, I'm currently on Docker version 20.10.21, build baeda1f
Compose is correctly added to my PATH vars under /usr/local/bin/, which has the following files:
com.docker.cli docker-credential-desktop fuzzy_match kubectl.docker
docker docker-credential-ecr-login httpclient vpnkit
docker-compose docker-credential-osxkeychain hub-tool xcodeproj
docker-compose-v1 docker-index kubectl
When I run which docker-compose, it returns /usr/local/bin/docker-compose so it seems like everything is configured correctly.
Also running docker-compose-v1 does seem to work for some weird reason.
Any ideas?
Edit: Seems like this was fixed after installing the newest version of Docker (Docker Desktop 4.14.1 (91661), Docker version 20.10.21, build baeda1f).

Install Rosetta 2 with softwareupdate --install-rosetta, then uncheck Use Docker Compose V2 in Docker Dashboard -> Settings -> General.

Related

When i run docker-compose on windows 11, i've an error 'docker: 'compose' is not a docker command.', despite that docker-compose is installed

i installed docker desktop on windows 11, following instruction here : docs.docker. I can run dockercommand but when i run docker-compose or docker compose i got the following error :
docker: 'compose' is not a docker command.
I can see the executables are installed correctly when i type :
where docker compose
// C:\Program Files\Docker\Docker\resources\bin\docker-compose
C:\Program Files\Docker\Docker\resources\bin\docker-compose.exe
where docker
// C:\Program Files\Docker\Docker\resources\bin\docker
C:\Program Files\Docker\Docker\resources\bin\docker.exe
I'm using git bash on Windows 11.
I'm expecting to read a docker-compose.yml file on a project by running docker-compose up.
I uninstall docker, then i restarted the computer and installed it again. And this time, instead of skipping the tutorial (quick start guide), i did it and everything worked fine.

error during connect: This error may indicate that the docker daemon is not running in cmd

I am a beginner at Docker. I need to create two containers for mongo and mongo-express. But, I'm getting an error as error during connect: This error may indicate that the docker daemon is not running.
Then I tried below steps:
I run the cmd as administrator. Then I run the command "C:\Program Files\Docker\Docker\DockerCli.exe" -SwitchDaemon. It didn't work for me. then I tried with 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchDaemon way. Then I enabled hypervisor also. Still, I am getting the same error. When I ran the docker version command in cmd I received the below-mentioned outputs:
Then after I tried with cd "C:\Program Files\Docker\Docker" and ./DockerCli.exe -SwitchDaemon separately.
docker info command gives below mentioned error:
C:\Windows\system32>docker info
Client:
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc., v0.10.0)
compose: Docker Compose (Docker Inc., v2.15.1)
dev: Docker Dev Environments (Docker Inc., v0.0.5)
extension: Manages Docker extensions (Docker Inc., v0.2.17)
sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
scan: Docker Scan (Docker Inc., v0.23.0)
Server:
ERROR: error during connect: In the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/info": open //./pipe/docker_engine: The system cannot find the file specified.
errors pretty printing info
Did you install the Docker Desktop on your Windows PC? If not please install it and Run it. If you already installed it, please run it first!
Then you can see whether the docker engine is starting or not!
After the docker engine started check whether this error is still there. Most probably error will fix after doing that!
If the docker engine is not started, please uninstall docker and delete everything from Registry.
Press Win+R and %appdata%\Docker to go and delete all the files.
Then reinstall the docker, if better you can install the docker desktop. Because with the docker desktop, the docker provides a whole bundle with it! Then you will be able to install the docker for windows smoothly.
Because this error usually getting when the docker engine is not started. Also, this may happen missing Linux kernel on windows. Both issues will address with the correct installation of the Docker Desktop.
You can check whether you have a docker Linux subsystem running on your windows pc by running the following command on cmd,
wsl -l
If you get a result like this,
C:\Users\gayan>wsl -l
Windows Subsystem for Linux Distributions:
docker-desktop-data (Default)
docker-desktop
Then you are okay and ready to go.
If not, please try to uninstall and install the docker desktop
Make sure you delete the previous registry, To do that press Win+R and type Regedit Then go to HKEY_LOCAL_MACHINE -> SOFTWARE -> Docker Inc and delete that folder.
If still you are getting the same error, try to troubleshoot the docker desktop. you can refer to the docker documentation.

Symfony CLI doesn't export docker desktop vars

I'm on mac (Apple chip), and I'm trying to create a Symfony project using Symfony CLI & Docker.
$ symfony create new_project
$ cd new_project
$ symfony composer require orm
It install Symfony, Doctrine, and ask me to create docker-compose.yml.
Perfect.
I can even launch docker-compose up --build and I can see the container being build & launched on my Docker Desktop application.
But when I launch my symfony server, I'm unable to connect to the database.
As I read, I try the command symfony var:export -vv and then, I can see than none of the docker variables are automatically exported. And I can see, thanks to the -vv option, this silent error :
WARNING symfony Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
I looked at this error and I try docker-machine ls. I can see that there is no docker-machine working on my computer, even if my Docker Desktop says otherwhise.
How can I make Docker Desktop & Symfony CLI works together ? Why docker-image and Docker Desktop doesn't communicate ?
When I look to the Docker Desktop documentation, they mention that the Docker Desktop provide the docker API through unix:///var/run/docker.sock but mine seams not working.
Thank you for your help :)
docker-machine is a legacy software for OSX. Uninstall it and install the latest version of docker using the command brew install --cask docker and then try the same steps as before.

Can't create a remote interpreter with Docker-compose

Hello guys i need your help!
I can't configure the remote docker-compose interpreter in PyCharm, I keep getting the following error:
and the corresponding log entry:
2020-08-09 02:45:55,299 [6304130] WARN -
ckaging.InstalledPackagesPanel - The following command was executed:
C:\Program Files\JetBrains\PyCharm 2020.1.3\bin\runnerw64.exe
C:\Users\Angel\Downloads\docker-compose-Windows-x86_64.exe -f
D:\Archiv\Projects\PycharmProjects\django_with_db\docker-compose.yml
-f C:\Users\Angel\AppData\Local\JetBrains\PyCharm2020.2\tmp\docker-compose.override.241.yml
run --rm --no-deps web
The exit code: 1
The error output of the command:
Couldn't find docker binary. You might need to install Docker:
https://docs.docker.com/engine/installation/windows/
docker-compose finished with exit code 1
In my case, PyCharm is installed on Windows 10, and Docker and Docker-compose are on a separate server running CentOS and I use the following settings:
Docker:
Interpreter:
At the same time, Docker as a remote interpreter works fine, the problem only concerns the docker-compose.
I don't know if this matter or not, but I want to point out, that since Docker is not installed on a windows host, when I first tried to create a remote interpreter using docker-compose, PyCharm showed a message – can’t find the docker-compose executable. To overcome this, I downloaded the executable for my platform from the official Docker repository and manually specify the path to it:
Whether this is the right solution I don't know, but it's works
I am using the following software versions:
Windows 10 build 19041
PyCharm Professional 2020.2
CentOS Linux release 8.2.2004
Docker version 19.03.12, build 48a66213fe
docker-compose version 1.26.2, build eefe0d31

Updating Docker, Docker Machine, Docker Compose

I am trying to update my docker related tools for macOS and I am unsure of how to go about it the following is my docker versions
Docker version 1.12.6, build 78d1802
docker-machine version 0.9.0, build 15fd4c7
docker-compose version 1.9.0, build 2585387
I do not use docker for mac and interact with docker via the command line. So my question is....How do I upgrade them individually or otherwise?
You can just use this link to download the new versión of docker, docker-machine and toolbox https://download.docker.com/mac/stable/Docker.dmg And continue using docker-machine

Resources