2

I am trying to figure out development with django and postgresql while using windows as the host OS. I followed 2 tutorials and both of them want me to run commands using docker-compose run, but it doesn't work on windows. It says:

> docker-compose.exe run web django-admin.py startproject rolesweb .
←[31mERROR←[0m: Interactive mode is not yet supported on Windows.
Please pass the -d flag when using `docker-compose run`.

Is there an alternative to this command? What should I do to be able to follow the tutorials further?

The tutorials: https://docs.docker.com/compose/django/ https://realpython.com/blog/python/django-development-with-docker-compose-and-machine/

CrabMan
  • 1,578
  • 18
  • 37
  • Can't you just pass the `-d` flag to the command? – ForceBru Dec 19 '15 at 17:13
  • The -d flag seems to launch each new command in a new container, also it doesn't give me the output of command and it doesn't allow me to provide input to the command interactively. So I don't really know how it works and what is the result. – CrabMan Dec 19 '15 at 17:18
  • What I typically do, I pull `docker-compose` image in my Docker machine and just call it with Docker cli from my windows. This way I'm effectively running `docker-compose` in Linux not Windows. – Boynux Dec 20 '15 at 17:14

1 Answers1

1

An alternative is to run docker-compose through a container where docker-compose is installed. That is what I initially recommended. In that context, the -d option would be supported.

docker-compose itself depends on nodejs/node-gyp which does not work well on Windows.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • That answer seems very confusing to me. If we use the boot2docker image in virtualbox as the docker host machine, and I want to use Pycharm and other programs to develop in windows, how do you forward all the ports so that they are accessible in windows? They are going to be visible only in the boot2docker image, aren't they? – CrabMan Dec 19 '15 at 18:00
  • @CrabMan I only mount the cwd (current working directory) into that docker-compose dedicated container (see the end of http://stackoverflow.com/a/29728993/6309) – VonC Dec 19 '15 at 18:02
  • so if you develop a web application, how do you access its web interface and maybe other ports from the outermost OS? – CrabMan Dec 19 '15 at 18:06
  • @CrabMan docker-compose will make docker run command for you (in the right order). the end result will be accessed the same way as if you had made those docker run yourself. Through the docker-machine ip address of the container, or through VirtualBox port forwarding, as I mentioned in http://stackoverflow.com/a/34219168/6309 – VonC Dec 19 '15 at 18:09
  • alright, thanks. Seems complicated enough that maybe I should just install ubuntu in dual-boot or in Virtualbox and install Pycharm and stuff inside it. – CrabMan Dec 19 '15 at 18:11
  • @CrabMan that is one way. Personnally, I do my own starting script myself, without `docker-compose` (like, for instance, https://github.com/VonC/b2d/blob/master/apache/run) – VonC Dec 19 '15 at 18:13