# Troubleshooting docker info and discourse



## NuLL3rr0r (Apr 22, 2016)

I've been trying to install Discourse on a FreeBSD VM without any success.

According to discourse installation guide the only supported platform is Docker, although it is possible to install it without Docker. Since I have to install two Discourse instance, going without Docker is not an option (Yes, I know there is jail but the discourse bundled web-based GUI for updating won't work without Docker which is a pain in the butt).

I followed this guide on FreeBSD wiki:
`$ cd /usr/ports/sysutils/docker-freebsd
$ make config-recursive
$ make install clean

$ kldload zfs
$ dd if=/dev/zero of=/usr/local/dockerfs bs=1024K count=4000
$ zpool create -f zroot /usr/local/dockerfs
$ zfs list
$ zpool list
$ zfs create -o mountpoint=/usr/docker zroot/docker
$ service docker onestart
$ ps auxw | grep docker`

But, upon bootstraping Discourse:
`$ bash launcher bootstrap app`

I get the following error


```
Cannot connect to the docker daemon - verify it is running and you have access
```

I investigated the bootstrap script:


```
# 1. docker daemon running?
  # we send stderr to /dev/null cause we don't care about warnings,
  # it usually complains about swap which does not matter
  test=`$docker_path info 2> /dev/null`
  if [[ $? -ne 0 ]] ; then
  echo "Cannot connect to the docker daemon - verify it is running and you have access"
  exit 1
  fi
```

And, tried the following command on csh/bash prompt:
`$ docker info`

Which outputs the following:

```
Get http://%2Fvar%2Frun%2Fdocker.sock/v1.19/info: EOF. Are you trying to connect to a TLS-enabled daemon without TLS?
```

I also checked if I have ca_root_nss installed, and it was there.

So, does anyone knows why `docker info` fails?


----------



## SirDice (Apr 22, 2016)

On what version of FreeBSD?


----------



## NuLL3rr0r (Apr 22, 2016)

SirDice said:


> On what version of FreeBSD?


10.3-RELEASE


----------



## priyadarshan (Sep 25, 2016)

You could look into this, or you could install docker on bhyve running a linux guest.

In that way you would have the latest version of docker, too.


----------



## NuLL3rr0r (Sep 30, 2016)

priyadarshan said:


> You could look into this, or you could install docker on bhyve running a linux guest.
> 
> In that way you would have the latest version of docker, too.



Thanks for the answer. Actually I solved the issue and there is no need for docker now.

BTW, I wrote that guide on installing Discourse on FreeBSD without Docker.


----------



## priyadarshan (Sep 30, 2016)

Nice, thank you for the How-To guide.

Perhaps you could consider publishing on this Forums as well (Howtos and FAQs section), as it can be quite handy.


----------



## NuLL3rr0r (Oct 4, 2016)

Sorry for my tardy reply, been busy with my TOEFL iBT exam.

Well, I would like too. But, unfortunately I'm giving up on Discourse as a comment system for various reasons. For example, I just realized out of a sudden it duplicates my posts and creates a new thread for each post which means it won't show previous comments. Furthermore, it's a memory hog (perhaps RoR faults). I believe it's too heavy for such a small task such as a comment system. A small comment system in Go Lang would be nice. I may start implementing my own comment system as I did with my subscription system because I wasn't satisfied with the current ones. Last but not least, I do not want to deal with building Ruby Gems which is a tedious task in case they fail to build.

Anyway I updated that posts with a few pitfalls and their solutions on FreeBSD 11.0-RELEASE. Perhaps you can ask the moderators and maintain a guide on Discourse if you would like, too. I'll be glad to use that as a basis for your Howto/Guide.


----------



## hukadan (Oct 4, 2016)

Since your subscription system (and your blog engine) already need www/node, you could give a try to the NodeBB bulletin board system. There is a plugin to use it as a comment system (for Ghost and Wordpress at the moment, but it is just a matter of small Javascript programming). NodeBB team uses it for its own Blog so you can have a demo here.


----------



## NuLL3rr0r (Oct 4, 2016)

Thank you so much @jukadan. Even though it's at 0.3 version, it looks so nice. I must give it a try.

Btw, I probably move away from Hexo, too. I benchmarked Hugo and it's blazing fast. Octopress (my original blog generation engine) took approximately 8 minutes to generate the blog (that's why I migrated to Hexo). Hexo takes ~8 seconds to generate the same contents. Hugo does that in milliseconds. The only thing I miss from Hexo which Hugo lacks is the Post Asset Folder feature. When it comes to feature vs performance I always go with the performance.

I must admit however, I'm a bit fanatic when it comes to native languages such as C, C++, D, Rust and Go and their performance. Hopefully, many people started moving to native languages for their web-related FLOSS projects. e.g. Hugo, Gogs (compare it to GitLab), ... Regarding Node.js usage in the blog subscription system (C++), it only gets pulled-in by CMake at compile time for converting SASS to CSS and HTML/JS/CSS optimization by Gulp at compile time (yes, no native tool comparable to Grunt or Gulp). There is no need for that at run-time.


----------



## priyadarshan (Oct 4, 2016)

Thanks, I did not know about NodeBB. NodeBB's installation on FreeBSD looks refreshingly simpler. I will definitely give it a try.


----------



## hukadan (Oct 4, 2016)

Well, it is even simpler. You just need to install www/npm2, it will pull all the dependencies you need (*Edit : except for database dependencies*). To be complete, I also propose a non official package. It needs some polishing though. I will update it to the latest version of NodeBB (v1.2.0 released this week-end) later this week.


----------



## priyadarshan (Oct 4, 2016)

hukadan That is good news. Let me know when it is updated. I would be happy to help testing it.


----------



## TomHsiung (Jan 23, 2018)

NuLL3rr0r said:


> Thanks for the answer. Actually I solved the issue and there is no need for docker now.
> 
> BTW, I wrote that guide on installing Discourse on FreeBSD without Docker.



Hi,

Where is the guide for installing Discourse without Docker on FreeBSD you had written? Thanks.


----------



## p3rj (Jan 23, 2018)

The link was in the post just above the one where NuLL3rr0r noted it was his article that was referred to (i. e., in post #4, pointing to this blog post).


----------

