Phundament under Windows - "Interactive mode is not yet supported on Windows" - windows

I have Docker Toolbox installed under Windows 7. The Docker daemon is running inside a VM (the default behavior of Docker Toolbox).
I am trying to get Phundament running using the default tutorial.
It all works fine until I reach this command:
docker-compose run php composer install
It results in:
I've successfully attached to the running container using docker exec -it <container ID> bash but when I do a ls /app command on any of the two containers I get no files in that directory. In effect, the attempt to run composer install there fails.
I tried attaching to both containers and the result is identical.

I also noticed that behavior just recently, it's sadly a limitation of docker-compose on Windows.
For the command you mentioned you can actually run
docker-compose run -d php composer install
As general workarounds...
use docker exec -it app_php_1 bash
see also https://getcarina.com/docs/troubleshooting/troubleshooting-cannot-enable-tty-mode-on-windows/
if you don't really need an interactive shell, you could just run a command or script, like docker-compose run -d php setup.sh
Note: I need to double-check the above suggestions on a real Windows testing system.
PS: I am the author if Phundament. I've also just created an issue for this.

Please try:
winpty docker-compose run php composer install
it works for example:
winpty docker run --rm -it debian bash

Related

Docker setup on WSL for a Laravel website

I have entered into the WSL terminal the following command:
docker compose build --no-cache && docker compose up
This is what happened:
I have not downloaded anything outside of Docker on this computer and I have cloned this "backend" from the repository.
I have no experience in Docker or Laravel.
What methods should I start with to fix this?
The option -g in the groupadd command needs to be numerical, you can't use use the word sail.
See Ubuntu's documentation about that command and option here.

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.

Error while running a container using docker

I have installed docker in my machine
I could successfully pull images from the repository and the pulled images are clearly listed when I see the list of images pulled.
The docker service was also started using
sudo service docker start
However, when I try to run the same using the command,
sudo docker run -it ubuntu:12.04
I am getting the following error
docker: Error response from daemon: Container command '/bin/bash' not
found or does not exist..
The issue remains the same for any image that I have tried with
What could be the reason for this issue?
It depends on your version of docker, but check if you have issue 23411, where adding a workdir is needed:
sudo docker run --workdir /var -it ubuntu:12.04
There seem to be some recent bug in start.go, and a PR in progress.

How can I keep a docker debian container open?

I want to use a debian Docker container to test something, and by this I mean execute some commands in the debian bash console. I tried downloading the image using docker pull debian and then running it using docker run debian, but I get no output. What am I doing wrong? Shouldn't the docker container stay open until I close it?
You need to explicitly run bash:
docker run -it debian /bin/bash
The -i means "run interactively", and -t means "allocate a pseudo-tty".
A good place to read a bit more is the section Running an interactive shell in the Quickstart documentation.

'docker run -v' does not work on Windows using Docker Toolbox

When running the following command from a CoreOS VM, it works as expected:
docker run --rm -v $PWD:/data composer init
It will initialize the composer.json file in the current working directory by using the Docker volume mapping as specified. The Docker container basically has the PHP tool composer installed and will run that tool inside the /data folder of the container. By using the mapping it actually applies it on the files on the host machine.
However when trying to run this command on Windows using Docker Toolbox I get the following error.
$ docker run --rm -v $PWD:/data composer --help
invalid value "C:\\Users\\Marco;C:\\Program Files\\Git\\data" for flag -v: bad mount mode specified : \Program Files\Git\data
See 'C:\ProgramData\Chocolatey\lib\docker\bin\docker.exe run --help'.
What I notice here is although I am in Git Bash when executing the command it still uses Windows paths. So then I tried following (surround with quotes):
$ "docker run --rm -v $PWD:/data composer --help"
bash: docker run --rm -v /c/Users/Marco:/data composer --help: No such file or directory
Now it is unable to find the directory.
I also tried without the $PWD variable, but this doesn't make a difference.
How do I make this work on Windows?
This should work:
$ docker run --rm -v //c/Users/Marco:/data composer --help
Try MSYS_NO_PATHCONV=1 docker run ...
Git Bash tries to convert the path for other Windows commands.

Resources