I tried this today, and also ran into issues. The error I saw was because Docker’s architecture emulation doesn’t support inotify (which we use a lot in Discourse development). For now, I’ve added a warning to d/boot_dev when a non-x86_64 architecture is detected:
❯ d/boot_dev
WARNING: Docker architecture is not x86_64.
Discourse development is unlikely to work using Docker's architecture emulation.
Please try a native development installation.
I’ve now added a d/ember-cli helper, and forwarded port 4200 by default. The info at the top of this topis has also been updated. Once you’ve updated, run d/rails s in one terminal, and d/ember-cli in another. I’ve also set NO_EMBER_CLI as one of the variables which is passed through to Docker, so that is available if needed.
@david probs inconsequential but just FYI: The boot_dev script prints out a false error finding on the x86_64 check when I accidentally ran without Docker on…(but the ‘Is the docker daemon running’ part is right)…
WARNING: Docker architecture is not x86_64.
Discourse development is unlikely to work using Docker's architecture emulation.
Please try a native development installation.
...(snip)...
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Thanks for this image, and the super-clear instructions!
I got psql: error: FATAL: Peer authentication failed for user "postgres" when running d/boot_dev --init.
Although the pg_hba.conf in data/postgres/ had all the authentication methods set to “trust”, there was another one in /etc/postgresql/13/main/ which had the defaults (“peer” / “md5”).
I edited /etc/postgresql/13/main/pg_hba.conf, changed all the methods to trust, did d/shell and ran sv restart postgres to pick up the changes – and was able to continue by running d/bundle install; d/rake db:migrate RAILS_ENV=development; d/rake admin:create manually.
Leaving here in case it’s helpful for anyone else!
However I’m having issues with creating a backup from the admin section.
The error I’m getting is: pg_dump: error: connection to database "discourse development" failed: FATAL: Peer authentication failed for user "postgres".
I checked the pg_hba.conf file, and have all options set to trust.
Would be great i could get some assistance on how to get this to work.
I tried on Ubuntu as well as on MacOSX. Everything is working fine on both (creating Posts, API…) except for the backup functionality.
LOAD_PLUGINS and RAILS_ENV must precede the command to assign environment variables. Following the command, they’re being treated as arguments to rspec, which it doesn’t understand.
Apologies, I misinterpreted your two commands as “the first works for this other spec, the second doesn’t work for this spec”. I don’t have a development environment set up to test.
Looking at the rspec file in Github, I think you’re right that it’s not passing in the environment variables. It looks like you should be able to run d/shell to get a shell inside the container, then run your rspec command there though.
OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: "LOAD_PLUGINS=1": executable file not found in $PATH: unknown
I’m having the exact same problem as Max. Whenever I try to make a backup or a restore on my local development docker install I get the same error: Peer authentication failed for user "postgres"
After some digging around I found that in the development environment the database configuration shows up like this:
Somehow the dev environment is not setting the username on the environment variables and then the BackupRestore module just defaults the username value to postgres
I’m trying to test a plugin using the docker setup. Randomly the app stops loading and I’m just presented with a blank page until I delete the data folder and rebuild everything. Any tips on how to debug the issue?