{"id":6867,"date":"2020-08-10T16:41:05","date_gmt":"2020-08-10T21:41:05","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=6867"},"modified":"2020-08-11T13:25:21","modified_gmt":"2020-08-11T18:25:21","slug":"discourse-in-docker-on-fedora-32","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=6867","title":{"rendered":"Discourse in Docker on Fedora 32"},"content":{"rendered":"<p>I had to make a few tweaks in order to run the Discourse base Docker image. First, I got the following very clear error:<\/p>\n<pre>discourse docker this version of runc doesn't work on cgroups v2: unknown<\/pre>\n<p>I had to switch from cgroupv2 to cgroup<\/p>\n<pre>grubby --update-kernel=ALL --args=\"systemd.unified_cgroup_hierarchy=0\"<\/pre>\n<p>At which point I was at least able to run through the configuration. This yielded an access denied error attempting to create \/shared\/postgres:<\/p>\n<pre>Configuration file at updated successfully!\r\n\r\nUpdates successful. Rebuilding in 5 seconds.\r\nBuilding app\r\nEnsuring launcher is up to date\r\nFetching origin\r\nLauncher is up-to-date\r\ncd \/pups &amp;&amp; git pull &amp;&amp; \/pups\/bin\/pups --stdin\r\nAlready up to date.\r\nI, [2020-08-11T18:15:03.664400 #1] INFO -- : Loading --stdin\r\nI, [2020-08-11T18:15:03.672609 #1] INFO -- : &gt; locale-gen $LANG &amp;&amp; update-locale\r\nI, [2020-08-11T18:15:03.746912 #1] INFO -- : Generating locales (this might take a while)...\r\nGeneration complete.\r\n\r\nI, [2020-08-11T18:15:03.747838 #1] INFO -- : &gt; mkdir -p \/shared\/postgres_run\r\nmkdir: cannot create directory \u2018\/shared\/postgres_run\u2019: Permission denied\r\nI, [2020-08-11T18:15:03.754890 #1] INFO -- :\r\n\r\nFAILED\r\n--------------------\r\nPups::ExecError: mkdir -p \/shared\/postgres_run failed with return #&lt;Process::Status: pid 21 exit 1&gt;\r\nLocation of failure: \/pups\/lib\/pups\/exec_command.rb:112:in `spawn'\r\nexec failed with the params \"mkdir -p \/shared\/postgres_run\"\r\nd98ee8471413ad77ab27ed3506f12c5c94a2b6902622faf4d88d5dbb51a10f63\r\n** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.\r\n.\/discourse-doctor may help diagnose the problem.<\/pre>\n<p>Gut was that I encountered an SELinux problem. Turns out I was right. There&#8217;s a lot of reading you can do about SELinux and Docker &#8212; <a href=\"https:\/\/prefetch.net\/blog\/2017\/09\/30\/using-docker-volumes-on-selinux-enabled-servers\/\" target=\"_blank\" rel=\"noopener noreferrer\">this, for one<\/a> &#8212; but the quick and simple solution is to run the docker container in privileged mode (note: this may <em>not<\/em> be a good idea in your specific scenario. understand what privileged mode is and the risks it entails). To do so, edit the launcher script (\/var\/discourse\/launcher in my case) and add\u00a0 &#8220;&#8211;privileged&#8221; to user_args:<\/p>\n<p><a href=\"https:\/\/www.rushworth.us\/lisa\/?attachment_id=6868\" rel=\"attachment wp-att-6868\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6868\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2020\/08\/discourse-docker-user_args.png\" alt=\"\" width=\"708\" height=\"320\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2020\/08\/discourse-docker-user_args.png 708w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2020\/08\/discourse-docker-user_args-300x136.png 300w\" sizes=\"auto, (max-width: 708px) 100vw, 708px\" \/><\/a><\/p>\n<p>And finally (and this may well be a RTFM thing) &#8212; you&#8217;ve got to have your <em>public<\/em> DNS set up &amp; whatever firewall rules to get traffic to the http:\/\/ website you are trying to build in order to use the LetsEncrypt SSL cert and configure HTTPS. It uses the file-based verification (i.e. create a file named xyz in \/path\/to\/xyz.whatever on your web server, lets encrypt grabs the file and verifies it exists) which fails quite spectacularly when the Internet at large cannot access your about-to-be-a-discourse-server.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I had to make a few tweaks in order to run the Discourse base Docker image. First, I got the following very clear error: discourse docker this version of runc doesn&#8217;t work on cgroups v2: unknown I had to switch from cgroupv2 to cgroup grubby &#8211;update-kernel=ALL &#8211;args=&#8221;systemd.unified_cgroup_hierarchy=0&#8243; At which point I was at least able &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[1081,231,868],"class_list":["post-6867","post","type-post","status-publish","format-standard","hentry","category-system-administration","tag-discourse","tag-docker","tag-selinux"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/6867","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6867"}],"version-history":[{"count":5,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/6867\/revisions"}],"predecessor-version":[{"id":6874,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/6867\/revisions\/6874"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6867"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6867"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6867"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}