Docker-Compose not installed with Docker Desktop - windows

I installed Docker Desktop v4.12.0 on windows 10 which installed docker v20.10.17.
I am trying to run docker-compose pull but get the response docker: 'compose' is not a docker command. I've tried reinstalling Docker Desktop but I still get the same error.
docker-compose --version and docker compose --version both return the same error message.
I'm new to docker and not sure if I've done something incorrectly. Any help would be greatly appreciated!

This can happen when we have older files laying around in windows path.
Try this in Linux:
where docker
where docker-compose
Or in Windows Powershell,
Get-Command docker
Get-Command docker-compose
If you have multiple paths, maybe one of them is very old.
In my case, I had to delete docker.exe and dockerd.exe in the root of c:\Program Files\Docker. The new files should be in the resources\bin folder.

Related

Docker compose V2: unknown shorthand flag 'f' (windows)

I'm currently running docker desktop version 20.10.22 (build 3a2c30b, fresh install) on Windows (using wsl2), but docker compose commands with the -f flag do not work correctly. Since I'm using docker compose V2 (checked the option in the docker desktop settings), my commands are with a space instead of a hyphen. I get the following message when running any docker compose command using -f:
unknown shorthand flag: 'f' in -f See 'docker --help'.
Specifically, I'm running the FIWARE NGSI-LD tutorials. All docker compose commands that are used within those tutorials fail. The commands can be found in the services file for each tutorial. For example, a command that fails (saying that the -f flag does not exist) within the Short-Term-History tutorial is the following:
docker compose -f docker-compose/mintaka.yml -p fiware up -d --remove-orphans --renew-anon-volumes
The weird thing is that docker compose --help and docker compose --version both return the output from respectively docker --help and docker --version, as if it excludes the compose keyword. The output of the above command also refers to the standard docker help command instead of the docker compose help.
UPDATE: Docker excludes the compose keyword between docker and the rest of the command. Replacing compose with a random string of letters gives the same effect. It seems as if it cannot recognize the compose keyword.
The old docker-compose is not installed so that does not work either. Running which docker-compose returns the docker-compose.exe location, inside the .../Docker/resources/bin folder. Running which docker compose returns the location of docker.exe. The .../Docker/resources/bin folder is inside the path environment variable.
Does anybody know what the problem might be? I've searched countless websites but did not find any solutions for this problem yet.
Kind regards
Here is what I have in running processes when I run docker compose events:
Please check if you have all these directories and files. Then we can troubleshoot further.
I reinstalled docker desktop with the same installer (also same version) and this resolved the problem weirdly enough...
The only difference between my old and new installation was that I already had wsl2 installed this time.

why docker container is not runnig in windows?

Help me friends, please. I'm a noob in docker.
I'm working with laravel an create project with Docker in location.
root#VIGIA-PC:/mnt/d/projects/fastfood-app/fastfood-api#
docker was working but when I shut down my pc, and then I turn on it, the docker container is not running, why?
when I go to to the project folder and type ls no appear files from debian terminal, when I going to windows they are here.
I runned docker ps and show the follow:
Information
windows version 10
distro linux debian
build 19042
Docker version 20.10.2, build 2291f61
You'll have to change the behavior of your docker apps.
If the host is being restarted, so are the containers running on it : https://docs.docker.com/config/containers/start-containers-automatically/
I have already solved my problem.that was a problem from path

docker-compose command not available for mac

I installed docker with the instructions here, downloading from docker-hub
https://docs.docker.com/docker-for-mac/install/
But when I run docker-compose I get this error
pyenv: docker-compose: command not found
The `docker-compose' command exists in these Python versions:
3.6.5/envs/myenv
Also, docker-compose is available under /Users
which docker-compose
/Users/<username>/.pyenv/shims/docker-compose
In this link says, docker-compose for mac need not be installed explicitly as it is part of docker for desktop mac.
https://docs.docker.com/compose/install/
Is something wrong with my installation?
I ran into the same issue on macOS today. Turned out that you need to run the installed app once, it does some additional downloading and setup. That setup includes setting up your path variables.
docker-compose is a utility that is now a parameter in mac docker
so instead of docker-compose up, its now docker compose up
if you install docker from official website then docker-compose will come along with that for mac so need to either upgrade and documentation is present there.

Run a docker image on Windows results in "oci runtime error: exec: "bash": executable file not found in $PATH."

I'm running Docker on Windows ("Docker Toolbox", not "Docker for Windows").
I've built an image with a rails app inside. It works properly on my Mac OS but stucks on production on Windows.
Using Docker 1.12 and docker-machine 0.8.0 on both machines.
When I create a machine and try to run the container from image, I do:
docker run -it myRepo:myTag bash
which opens me a interactive terminal on Mac OS, but Windows 7 and Windows Server 2011 are both responding with:
"Error response from daemon: oci runtime error: exec: "bash":
executable file not found in $PATH."
I use the MINGW64 shell via the Docker Quickstart Terminal but the old cmd.exe returns the same.
Can anybody help me with this issue? I've tried several hours to find a solution but there are too few answers for Windows.
Thank you in advance!
I also use Windows 7 with MINGW64. Here is what I get using nginx as example:
$docker run -it nginx bash
cannot enable tty mode on non tty input
I don't think you can open a tty using MINGW64.
You can try:
$docker run -i nginx bash
ls
bin
...
You will so no prompt or any indication you are inside the container. Just run ls and it should work inside your container.
Another option is to try to use winpty for the tty:
$ winpty docker run -it myRepo:myTag bash
root#644f59e6f818:/#
Have you tried?
$ winpty docker run -it myRepo:myTag /bin/bash
I haven't got the problem you are mentioning but I have seen it before when I was mapping volumes.
If you are mapping volumes using MINGW64, you will need to add an extra / before the local mapping. For example:
docker run -p 8080:80 -v "/$PWD":/var/share/nginx/html nginx
Let me know your findings.

docker-compose on Windows - Container command 'sh' not found or does not exist

Having some odd issues getting docker to behave on a windows host, but on a linux host its fine. Its just a simple node container that can run gulp (and will eventually be attached to other LAMP like containers).
my docker-compose.yml
version: '2'
services:
node:
build: ./node
container_name: cont_node
ports:
- "35733:35733"
volumes:
- ~/docker/project/www:/var/www/html/
command: "sh -c 'npm install && bower install && gulp'"
my Dockerfile
FROM node:4-onbuild
RUN npm config set registry http://registry.npmjs.org/
# Define working directory.
WORKDIR /var/www/html/
COPY ./package.json /var/www/html/
RUN npm install -g gulp-cli
CMD ["bash"]
so when I run
docker-compose up node
it returns
Container command 'sh' not found or does not exist.
Being that I understood the command command ran on the container (not the host), this should be fine? I have tried it with /bin/sh too and having the same problem. /bin/sh does exist, seems to be a sym link to dash if thats relevant? Looks identical to my linux host where this works fine.
Any ideas what is going wrong?
On a side note, anytime I use docker from a linux host it works like a dream, but windows I always lose hours wrestling with windows specific issues, npm installs dont seem to work properly or hang or take ages, issues with volumes not in my documents, etc. Is docker on windows / boot2docker fubar'ed or just me?
Runs fine for me on Windows 10 and Docker for Windows beta. I'd say either a outdated Docker setup or something is borked on your machine. If you are still running boot2docker try switching to Docker for Windows.
On a side note, anytime I use docker from a linux host it works like a dream, but windows I always lose hours wrestling with windows specific issues, npm installs dont seem to work properly or hang or take ages, issues with volumes not in my documents, etc. Is docker on windows / boot2docker fubar'ed or just me?
Well Windows always adds a bit of pain to almost anything :p, and in the early boot2docker days Windows support was quite buggy/incomplete, but with the latest Docker for Windows releases things are running pretty smooth now.
(posting this as answer since I don't have enough rep. to comment)
For some reason Docker attempts to run the command in the host instead of the guest. Since it says "container command" you may actually want to prepend it with "run", as in the online reference.

Resources