From my Ubuntu VM I was able to ping rubygems.org. I don’t know if there’s a way to check if the docker container can. I think I only pinged the http version, not https, though. Mentioning in case the problem is related to that. (One of the pages I saw when googling suggested changing https to http, but it’s not like I can do that since the defined behavior is somewhere in the docker container.)
I’ve tried the MacOS options.
First using Option 2, Homebrew. I ran into issues though as not all dependencies were installed using the command of this guide. A complete one-by-one guide to install Docker on your Mac OS using Homebrew helped me getting a bit further.
I’m now stuck at Step 2 d/boot_dev --init:
Migrating database...
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"?
/src/lib/site_settings/db_provider.rb:61:in `table_exists?'
/src/lib/site_settings/db_provider.rb:16:in `all'
/src/lib/site_settings/defaults_provider.rb:29:in `db_all'
/src/lib/site_setting_extension.rb:277:in `block in refresh!'
/src/lib/site_setting_extension.rb:274:in `synchronize'
/src/lib/site_setting_extension.rb:274:in `refresh!'
/src/lib/site_setting_extension.rb:495:in `block in setup_methods'
/src/config/initializers/004-message_bus.rb:120:in `<main>'
/src/config/environment.rb:7:in `<main>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Tasks: TOP => db:migrate => db:load_config => environment
(See full trace by running task with --trace)
I’ve then downloaded the .dmg file but as I’m new to Docker, I don’t understand what to do from there. It would be great to have a little more detailed description of the macOS option.
Thanks.
On MacOS, once you install Docker from the .dmg, just make sure it’s running — there should be an icon on the MacOS toolbar that you can use to check its status. Then literally follow the steps on the first post (clone, etc). Post here if you hit a problem going that route.
Mind, if you have installed docker with Homebrew before, it may be a good idea to uninstall that docker first or at least making sure that one is not running. I never installed docker with homebrew, so can’t advise there.
Thanks.
I’ve used the icon and opened the Docker dashboard. I didn’t find any containers running there on the command line I could see multiple containers running though. I was wondering if I had to sign in to use Docker dashboard? Or maybe this behaviour occurs since there are multiple versions of Docker installed Homebrew and Desktop (.dmg)?
In the meantime I’ve managed to setup Discourse on DigitalOcean which works without problems and is okay for my purposes.
The DMG installs docker, not discourse. It won’t add any containers initially.
From there you can follow the docker guide.
When running the above command (on a Mac) I get this error:
An error occurred while installing cppjieba_rb (0.3.3), and Bundler cannot continue.
Make sure that `gem install cppjieba_rb -v '0.3.3' --source 'https://rubygems.org/'` succeeds
before bundling.
Do you have any suggestions? I don’t understand exactly what the problem is. The separate gem install doesn’t work either (even with sudo).
Also, why do gems have to be installed when I’m running a docker image? That should have been fully pre-installed already, right?
UPDATE: FIXED
I cloned to
~/repos/discoursebut should have been to~/discourse. Works like a charm now.
If you get this error when running d/unicorn:
Could not find aws-partitions-1.284.0 in any of the sources
Run `bundle install` to install missing gems.
you can fix this by running:
docker exec -it -u discourse:discourse discourse_dev /bin/bash -c "cd /src && USER=discourse RUBY_GLOBAL_METHOD_CACHE_SIZE=131072 LD_PRELOAD=/usr/lib/libjemalloc.so RAILS_ENV=${RAILS_ENV:=development} bundle install"
after which d/boot_dev will run succesfully.
Simpler
d/boot_dev
d/bundle install
We have helpers for all the usual tasks.
In the OP it reads
The Docker development flow supports symlinks under the
plugins/directory
What do we symlink the plugins directory to in this context? Thanks!
cd plugins
ln -s /full/path/to/your/plugin .
ln -s ~/src/my-great-plugin # for example
Ah thanks just meaning to symlink to the plugins directory in this context.
Generally you don’t symlink an entire directory for this workflow as you would normally want granular control over which plugins were in scope during a run.
Hallo, ich verwende diesen Leitfaden und er funktioniert einwandfrei, aber meine Sorge ist, dass beim Ausführen von d/boot_dev immer wieder verschiedene Dinge heruntergeladen werden. Wie kann ich die erforderlichen Dateien nur einmal herunterladen und für den nächsten Start vorhalten? Mein Betriebssystem ist Ubuntu 20.04.
Versucht, auf einem frischen Mint 20-System zu installieren. Docker ist verfügbar:
terrapop@terrapop:/var$ docker version
Client: Docker Engine - Community
Version: 19.03.12
terrapop@terrapop:/var/discourse$ sudo systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset>
Active: active (running) since Mon 2020-08-24 19:03:48 CEST; 31min ago
Dann Discourse geklont:
sudo git clone GitHub - discourse/discourse_docker: A Docker image for Discourse · GitHub /var/discourse
cd /var/discourse
Allerdings führt d/boot_dev --init zu:
d/boot_dev --init
bash: d/boot_dev: Datei oder Verzeichnis nicht gefunden
Hat jemand eine Idee?
Update: Ich habe jetzt unsere SendGrid-API-Schlüssel zur app.yml hinzugefügt und die App über ./launcher gebootet. Sie läuft nun auf localhost. Könnte es sein, dass alle d/-Befehle im Originalbeitrag veraltet sind? Trotzdem verstehe ich es nicht. Die App läuft jetzt in Docker auf meinem Ubuntu (Mint)-Computer auf localhost, genau wie auf der Staging-Umgebung bei Digital Ocean. Wir möchten lokal entwickeln, wobei die App über Docker mit Symlinks für Plugins läuft, aber ich bin mir nicht sicher, ob sie jetzt so einsatzbereit ist, wie sie sein sollte, da ich die d/-Befehle in keiner Weise ausführen kann. Kann jemand bitte einen Beitrag leisten? Danke.
Update: Mein Fehler. Ich habe den Git-Link für die Produktion verwendet:
git clone GitHub - discourse/discourse_docker: A Docker image for Discourse · GitHub /var/discourse
Statt:
git clone GitHub - discourse/discourse: A platform for community discussion. Free, open, simple. · GitHub
![]()
Aber…
Jetzt habe ich neue Probleme. Ich kann unter Ubuntu Mint 20 (UID 0) nur als Superuser/root nach /var klonen. Wenn ich also klone und d/boot_dev --init ausführe, wird alles heruntergeladen und startet problemlos. Später wirft das Skript jedoch einen Permission-Fehler, da es erwartet, etwas mit UID 1000 auszuführen. Das ist der erste erstellte Benutzer auf Mint, also mein persönliches Konto (terrapop), und nicht root. Wie komme ich um dieses Problem herum?
Lösung: Einfacher als gedacht. Einfach ein neues www-Verzeichnis in var erstellen. Das www-Verzeichnis mit chown und chmod auf deinen ersten Benutzer auf Mint ändern und dann wie in den Beiträgen des Originalautors fortfahren. Funktioniert jetzt. Freut mich.
Aus irgendeinem Grund funktionierten die Symlinks zu meinen Plugin-Quellverzeichnissen nicht, und ich musste die Plugin-Quellverzeichnisse manuell in das Verzeichnis plugins verschieben bzw. kopieren, damit sie nach dem Neustart des Docker-Containers unter /admin/plugins angezeigt wurden.
Vielleicht hat sich etwas an der Art und Weise geändert, wie Docker Symlinks unterstützt? Ich verwende docker-ce 19.03.12 auf Ubuntu.
Ich habe das kürzlich auch mit Docker Desktop für Mac erlebt.
Ich habe dieselben Schritte auf einem $5 DO-Droplet durchgeführt. Alles verlief problemlos. Wie kann ich meine Site jetzt freischalten, damit ich darauf zugreifen kann?
P.S. Es funktioniert mit ngrok. Mit einem Nginx-Reverse-Proxy auf Port 9292 funktioniert es noch nicht.
Danke dafür. Sie können dies direkt auf dem Server tun und müssen keinen Nginx-Reverse-Proxy konfigurieren. Ich genieße das d/o Docker- und VSCode-Remote-Setup ![]()
Verwenden Sie d/unicorn -D, um Unicorn als Daemon zu starten, damit die Shell nach dem Starten des Servers weiterhin nutzbar bleibt.
Außerdem benötigen Sie mindestens einen $10 DO-Droplet.
Ich verwende einen Mac mit zsh (in iTerm2) und wenn ich versuche, symbolische Links für die Plugin-Entwicklung zu verwenden, stecke ich bei folgenden Fehlern fest:
readlink: illegale Option -- f
Verwendung: readlink [-n] [Datei ...]
Das liegt daran, dass die Mac-Implementierung des readlink-Befehls sich leicht von der GNU-Version unterscheidet.
Der einfachste Weg, dies zu lösen, ist folgender:
# brew install coreutils
# ln -s "$(which greadlink)" "$(dirname "$(which greadlink)")/readlink"
Dadurch haben Sie die Möglichkeit, eine kompatible Version von readlink zu verwenden.
Denken Sie bitte daran, dass der Wert von dirname "$(which greadlink)" in Ihrer PATH-Umgebungsvariable vor /usr/bin (wo sich normalerweise das originale readlink befindet) stehen muss. In meinem Fall sieht PATH so aus: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:..., und der symbolische Link zu greadlink befindet sich in /usr/local/bin.
Referenz: Fixing "readlink: illegal option -- f" error on a Mac
Um eine einzelne Plugin-Test-Suite auszuführen, gehen Sie wie folgt vor:
# d/rake "plugin:spec[PLUGIN_NAME]"