Docker Community Forums

Share and learn in the Docker community.

Preferred way to run docker-compose in interactive mode

(Chris Van Pelt) #1

Expected behavior

I want to call docker-compose run service and be put into an interactive session.

Actual behavior

I get “Interactive mode is not yet supported on Windows”


With the docker toolbox users would fire up an image with docker-compose running and run commands from it: I’m not sure how to replicate that in the new Docker for Windows world. I would think I could also start a service in daemon mode and attach to it but I’m unable to get that working in a simple container just running bash. Any guidance as to the preferred method for running docker-compose services interactively would be much appreciated.

(Michael Friis) #2

@vanpelt We’re working on liberalizing this in docker-compose:

Thanks for reporting!

(Chris Van Pelt) #3

I just wanted to mention I’m getting around this by bringing up my compose containers and attaching to them with docker exec -it flowerai_web_1 bash to run any one-off commands I happen to need.

(Phrrezende) #4

I’m with same problem.
I’m using Quickstart Terminal and docker-compose version 1.7.1, build 0a9ab35.

(Rolf Neugebauer) #5

you could try prefixing the command with winpty, which ships with git bash…YMMV though

(Phrrezende) #6

All right. I’ll try this.


(Phrrezende) #7

Sadly, don’t work!

(Janov) #8

@rneugeba: winpty did the job, tnx!

winpty docker exec -it mediawiki_web_1 bash

root@bd9007e832ec:/# ls
bin  boot  data  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var

PS: I should add that I’ve added the following to my docker-compose.yml-file:

  stdin_open: true
  tty: true

(Juliosbonifacio) #9

It works fine,

I try with:

$ winpty docker exec -it --user www-data core bash
www-data@f5d8d4f0347f:/srv/app$ ls -la
total 33
drwxr-xr-x 2 root root 4096 Dec 19 17:09 .
drwxr-xr-x 3 root root 4096 Dec 16 19:09 …
-rwxr-xr-x 1 root root 35 Dec 19 16:10 .gitignore
-rwxr-xr-x 1 root root 209 Dec 19 17:09 composer.json
-rwxr-xr-x 1 root root 20792 Dec 19 17:11 composer.lock
drwxr-xr-x 2 root root 0 Dec 16 21:03 config
drwxr-xr-x 2 root root 0 Dec 19 15:57 docker
-rwxr-xr-x 1 root root 0 Dec 16 21:03 docker-compose.yml
drwxr-xr-x 2 root root 0 Dec 19 17:13 src
drwxr-xr-x 2 root root 0 Dec 19 17:11 vendor
drwxr-xr-x 2 root root 0 Dec 19 15:11 web

Thanks a lot!

(Wonkabar) #10

absolutely the best solution.
stdin_open: true
tty: true
worked like a charm.
Thank you