# Does discourse support docker on windows?

**URL:** https://meta.discourse.org/t/does-discourse-support-docker-on-windows/37577
**Category:** Self-hosting
**Tags:** docker
**Created:** [January 7, 2016, 6:46am UTC](https://meta.discourse.org/t/does-discourse-support-docker-on-windows/37577 "2016-01-07T06:46:50Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![zh99998](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zh99998/32/100179_2.png) [@zh99998](https://meta.discourse.org/u/zh99998)
#### Post date: [January 7, 2016, 6:46am UTC](https://meta.discourse.org/t/does-discourse-support-docker-on-windows/37577/1 "2016-01-07T06:46:50Z")

</div>

docker is officially support windows platform now (via vbox)  
[https://docs.docker.com/windows/step\_three/](https://docs.docker.com/windows/step_three/)

can discourse run in docker on windows? and how to do it

---

<div class="post-metadata">

### Author: ![omfg](https://avatars.discourse-cdn.com/v4/letter/o/5e9695/32.png) [@omfg](https://meta.discourse.org/u/omfg)
#### Post date: [January 8, 2016, 4:14am UTC](https://meta.discourse.org/t/does-discourse-support-docker-on-windows/37577/2 "2016-01-08T04:14:23Z")

</div>

I don’t think Discourse knows where Docker runs.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 8, 2016, 4:17am UTC](https://meta.discourse.org/t/does-discourse-support-docker-on-windows/37577/3 "2016-01-08T04:17:28Z")

</div>

Does not matter, huge swaths of Ruby and common gems are incompatible with Windows. Not to mention the other stuff in the stack. Won’t work.

---

<div class="post-metadata">

### Author: ![omfg](https://avatars.discourse-cdn.com/v4/letter/o/5e9695/32.png) [@omfg](https://meta.discourse.org/u/omfg)
#### Post date: [January 8, 2016, 4:20am UTC](https://meta.discourse.org/t/does-discourse-support-docker-on-windows/37577/4 "2016-01-08T04:20:23Z")

</div>

It’s Docker **on** Windows, but inside of Docker it’s Ubuntu, as far as I can tell.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [January 8, 2016, 4:23am UTC](https://meta.discourse.org/t/does-discourse-support-docker-on-windows/37577/5 "2016-01-08T04:23:02Z")

</div>

I think the way the windows one works is similar to mac, the client runs in windows but the docker server runs in a VM.

`launcher` uses tons of `bash` so you would not be able to run unless it had cygwin (which it seems to be mucking with)

Try it out and see if it works, I don’t know.

Worst case, you have a VM running docker anyway, so log in to it and run launcher there.

---

<div class="post-metadata">

### Author: ![RBoy](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@RBoy](https://meta.discourse.org/u/RBoy)
#### Post date: [April 4, 2017, 6:27pm UTC](https://meta.discourse.org/t/does-discourse-support-docker-on-windows/37577/10 "2017-04-04T18:27:28Z")

</div>

Did anyone try this? Did installing Discourse on Docker for Windows work? .

---

<div class="post-metadata">

### Author: ![iamntz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamntz/32/114670_2.png) [@iamntz](https://meta.discourse.org/u/iamntz)
#### Post date: [June 1, 2018, 12:58pm UTC](https://meta.discourse.org/t/does-discourse-support-docker-on-windows/37577/11 "2018-06-01T12:58:10Z")

</div>

Pretty late at the party, but… here is my experience with docker on windows: (tl;dr: don’t work. yet)

1. Last Windows 10 update allows you to run windows executables from bash (and probably viceversa)
2. So _in theory_ you only need to replace all `docker` commands with `docker.exe`. Yay!
3. Unfortunately, this won’t work though, because it _seems_ that some paths are lost in translation. Nay!

```plaintext
/mnt/s/discourse$ ./bin/docker/boot_dev --init
Using source in: /mnt/s/discourse
Using data in: /mnt/s/discourse/data/postgres
e5cc992eb5220a72c28016ea4c41de0a78cb3a37278be5284956047df63a11f4
Installing gems...
unable to setup input stream: unable to set IO streams as raw terminal: The handle is invalid.

```

So I tried to get all `boot_dev` commands converted to windows cmd (I’m assuming that the repo is cloned in `s:\discourse`):

```plaintext
mkdir "s:\discourse\data\postgres"
docker run -d -p 1080:1080 -p 3000:3000 -v "s:\discourse\data\postgres:/shared/postgres_data:delegated" -v "s:\discourse:/src:delegated" --hostname=discourse --name=discourse_dev --restart=always discourse/discourse_dev:release /sbin/boot
docker exec -it -u discourse:discourse discourse_dev /bin/bash -c "cd /src && ls -la && RAILS_ENV=development bundle install"

```

Until this point, I don’t get any errors. Things looks good!

Let’s do the migration:

```plaintext
docker exec -it -u discourse:discourse discourse_dev /bin/bash -c "cd /src && RUBY_GLOBAL_METHOD_CACHE_SIZE=131072 LD_PRELOAD=/usr/lib/libjemalloc.so RAILS_ENV=development bundle exec rake db:migrate"

```

```plaintext
rake aborted!
PG::ConnectionBad: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

```

Oh, no! Postgres is installed? Yes, it is! But for some reasons this is where i’m stuck. If I try to connect dirrectly fails, as the DB is not compatible:

```plaintext
λ postgres.exe --config-file=S:\discourse\data\postgres\postgresql.conf
2018-06-01 12:17:00.063 UTC [25588] LOG: listening on IPv6 address "::1", port 5432
2018-06-01 12:17:00.064 UTC [25588] LOG: listening on IPv4 address "127.0.0.1", port 5432
2018-06-01 12:17:00.073 UTC [25588] FATAL: database files are incompatible with server
2018-06-01 12:17:00.073 UTC [25588] DETAIL: The database cluster was initialized with USE_FLOAT8_BYVAL but the server was compiled without USE_FLOAT8_BYVAL.
2018-06-01 12:17:00.073 UTC [25588] HINT: It looks like you need to recompile or initdb.
2018-06-01 12:17:00.076 UTC [25588] LOG: database system is shut down

```

So I assume my version isn’t compatible with Discourse.

```plaintext
λ postgres.exe --version
postgres (PostgreSQL) 10.4

```

(also tried with 9.x but I had pretty much the same result)

* * *

Other stuff:

`postgresql.conf` have errors that are not compatible with Windows:

```plaintext
dynamic_shared_memory_type = posix	# the default is the first option

lc_monetary = 'en_US.UTF-8' # locale for monetary formatting
lc_numeric = 'en_US.UTF-8' # locale for number formatting
lc_time = 'en_US.UTF-8' # locale for time formatting

```

* * *

So for now it’s a dead end for me. Maybe in the future i’ll have enough patience to go through all of these again, but today was enough 😃

* * *

> [@How to get a docker image of discourse using bash on windows 10?](https://meta.discourse.org/t/how-to-get-a-docker-image-of-discourse-using-bash-on-windows-10/64756/):
>
> I am very new to the concept of Docker. Can somebody help me out on how to get a docker image of discourse for Windows 10 via bash ( I have Ubuntu 14.04.5 LTS on my bash)?
