# 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:** 1
**Showing post:** 11

<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)?

---

_[View the full topic](https://meta.discourse.org/t/does-discourse-support-docker-on-windows/37577)._
