Beginners Guide to Install Discourse for Development using Docker

I made a list of all the files and went through all of them. They all worked. Afterwards I ran the checkbashisms script on them and I discovered something very weird.

bin/docker/boot_dev x
possible bashism in bin/docker/boot_dev line 35 (should be VAR="${VAR}foo"):
what it is: ENV_ARGS+=" -e $2"

what would be sh complaint: ENV_ARGS="${ENV_ARGS} -e $2"

bin/docker/rails x
possible bashism in bin/docker/rails line 4 (alternative test command ([[ foo ]] should be [ foo ])):
if [[ $# = 1 ]] && [[ “$1” =~ “s” ]];
bin/docker/unicorn x
possible bashism in bin/docker/unicorn line 4 (alternative test command ([[ foo ]] should be [ foo ])):
if [[ $# = 1 ]] && [[ “$1” =~ “s” ]];

so why did the scripts still work even though they shouldnt?
nixos /bin/sh is actually bash. Probably its best to talk with the people at nixos what is going with this. They seem to be really strict about not having /bin/bash but whats the point if thats bash anyway? There seems to be an effort to get discourse to be a nix package aswell: Its probably really nice for deployment and testing (if it works). Anway…all I wanted to do is write a discourse plugin … and now I am reading about this. :laughing:

1 Like

Yeah I am not against bin/sh but it needs to be ported and the scripts use bash-isms now.

Symlink bin/bash ?

I will do that. I think this was all a waste of time. (sorry for that :upside_down_face: ) This problem is clearly on the side of nixos. It has many benefits and I like using it, but this thing was just weird.


The Docker development flow now supports plugin symlinks, with two caveats:

  1. The symlink must refer to its target with an absolute path:

    - ln -s ../../discourse-plugin
    + ln -s ~/src/discourse-plugin
  2. Whenever a new plugin symlink is created, the Docker container must be restarted:

    d/shutdown_dev; d/boot_dev

Hopefully someone else will also find this useful!

(Also updated the topic wiki)


This is awesome, thanks heaps for the new feature, real happy to have parity with this setup!


Trying to get to the rails console to run SiteSetting.enable_sso = false on a Mac Docker dev install. Where do I need to be to do that?

d/rails c

from the root directory of discourse.


Thanks so much, Sam.

For others seeing this, you have to follow the above exactly. e.g. you can’t use rails c from the the d directory.

From within the d directory you’d need to run ./rails c, rails c would give you whatever rails was in your path, not the one in d.