I tried the following the Developing using Docker guide:
$ 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:
$ 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:
$ 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:
$ cd /tmp/discourse
$ ./bin/docker/boot_dev --init
Container spun and gems bundled, but database migration failed:
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:
$ docker exec -it discourse_dev bash
# cd src
# rake db:migrate
But the migrations did not succeed.
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.