8

When running docker-compose up in Windows PowerShell using Docker Desktop on WSL2, I get

Creating network "test_default" with the default driver
Building master
failed to get console mode for stdout: The handle is invalid.

There is a hint at failed to get console mode for stdout: The handle is invalid:

The problem is, I don't see output when image is building

What is to be done with the warning, if at all?

I have only very vague ideas what might help, at least if it is about the lack of a terminal to stdout. This is just a brainstorming:

  • Install a package equal to "console-setup" (e.g. gnome-terminal with DEBIAN_FRONTEND=noninteractive apt-get install -y gnome-terminal).
  • Switch on the terminal dialog of chosen commands with TERM=$TERM DEBIAN_FRONTEND=dialog apt-get install -y MY_COMMAND. Somehow I have never got this to work in a Dockerfile, but perhaps it works in a docker-compose command?
  • Avoid any terminal dialog by DEBIAN_FRONTEND=noninteractive apt-get install -y MY_COMMAND.
  • Or use -tty parameter to get a pseudo terminal.
questionto42
  • 1,861
  • 3
  • 21
  • 52
  • I am getting this 'error' too. I am using ms's new terminal app – user528025 Mar 22 '21 at 12:42
  • 2
    I am getting this issue too, using Windows Terminal and `pwsh`. I don't get this issue when I use Ubuntu in Windows Terminal. In this particular case I'm using Ubuntu 20.04 in WSL2. – codedog Mar 22 '21 at 19:24
  • 2
    https://github.com/docker/compose/issues/8186 – Pang Mar 23 '21 at 05:13
  • Taking up the thread of @Pang, https://github.com/docker/compose/issues/8186#issuecomment-799792476 has the direct answer of how to get rid of the warning. It is likely that the warning is not important and that it will just disappear with future Docker updates. – questionto42 Mar 23 '21 at 11:01
  • I have tried getting rid of the warning adding COMPOSE_DOCKER_CLI_BUILD=0 in the "command:" or in the "environment:", to no avail. I finally found out that it already appears before the build of the Dockerfile (Ctrl-C before the end of the build, and the warning appeared already before the build), and only if you docker-compose up --build (= docker-compose build). Thus, neither changes of the docker-compose, nor of the Dockerfile will remove the warning. There is no warning when you run the same code on a standalone Ubuntu (that is, without any WSL or VirtualBox involved, just Linux). – questionto42 Mar 23 '21 at 16:49

0 Answers0