# Issue regarding Docker development image

**URL:** <https://meta.discourse.org/t/issue-regarding-docker-development-image/53702>\
**Category:** Development\
**Created:** [2. Dezember 2016 um 17:47 UTC](https://meta.discourse.org/t/issue-regarding-docker-development-image/53702 "2016-12-02T17:47:12Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![ibnesayeed](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ibnesayeed/32/120427_2.png) [@ibnesayeed](https://meta.discourse.org/u/ibnesayeed)\
**Post date:** [5. Dezember 2016 um 04:13 UTC](https://meta.discourse.org/t/issue-regarding-docker-development-image/53702/4 "2016-12-05T04:13:37Z")

</div>

I tried the following the [Developing using Docker](https://github.com/discourse/discourse/tree/master/bin/docker) guide:

```plaintext
$ cd /tmp
$ git clone https://github.com/discourse/discourse.git
$ cd discourse
$ ./bin/docker/boot_dev --init

```

Realized that it is looking for `discourse/discourse_dev:latest` image which doesn’t exist in the DockerHub repository. So I decided to build it locally and tag accordingly:

```plaintext
$ cd /tmp
$ git clone https://github.com/discourse/discourse_docker.git
$ cd discourse_docker
$ docker build -t discourse/discourse_dev image/discourse_dev

```

It complained about missing template files and failed to build. So I looked at the corresponding Dockerfile to find out what files are being added then I copied them from the template directory:

```plaintext
$ cp templates/redis.template.yml templates/postgres.template.yml image/discourse_dev
$ docker build -t discourse/discourse_dev image/discourse_dev

```

Voila! Success! 🙂

Going back to the main discourse directory to setup the work environment:

```plaintext
$ cd /tmp/discourse
$ ./bin/docker/boot_dev --init

```

Container spun and gems bundled, but database migration failed:

```plaintext
Bundle complete! 98 Gemfile dependencies, 184 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
Post-install message from certified:
IMPORTANT: Remember to use the included executable `certifed-update` regularly to keep your certificate bundle up to date.
Migrating database...
Rails Error: Unable to access log file. Please ensure that /src/log/development.log exists and is writable (ie, make it writable for user and group: chmod 0664 /src/log/development.log). The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
rake aborted!
Errno::EACCES: Permission denied @ rb_sysopen - /src/tmp/ember-rails/ember.js
/src/config/environment.rb:5:in `<top (required)>'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
Creating admin user...
Rails Error: Unable to access log file. Please ensure that /src/log/development.log exists and is writable (ie, make it writable for user and group: chmod 0664 /src/log/development.log). The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
rake aborted!
Errno::EACCES: Permission denied @ rb_sysopen - /src/tmp/ember-rails/ember.js
/src/config/environment.rb:5:in `<top (required)>'
Tasks: TOP => admin:create => environment
(See full trace by running task with --trace)

```

So, I decided to dive inside the running container and run the migrations manually:

```plaintext
$ docker exec -it discourse_dev bash
# cd src
# rake db:migrate

```

But the migrations did not succeed.

```plaintext
URGENT: 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"?
 Failed to initialize site default
URGENT: 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"?
 Failed to initialize site default
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"?

Tasks: TOP => db:migrate
(See full trace by running task with --trace)

```

From here I am not sure what else should I try.

---

_[View the full topic](https://meta.discourse.org/t/issue-regarding-docker-development-image/53702)._
