Could not determine asterisk version: Asterisk 14

I’m trying to install Freepbx with Asterisk 14 into a docker container based on CentOS 6, running on a Synology RS812+ box with DSM 6 and a pre-existing mariadb. I’ve got DAHDI and all the other prerequisites compiling and installing.
I install Asterisk and:

chown -R $ASTERISKUSER. -v /var/run/asterisk
chown -R $ASTERISKUSER. -v /etc/asterisk
chown -R $ASTERISKUSER. -v /var/{lib,log,spool}/asterisk
chown -R $ASTERISKUSER. -v /usr/lib64/asterisk
chown -R $ASTERISKUSER. -v /var/www/
chown -R $ASTERISKUSER. -v /var/www/*

However, when I get to FreePBX:

./install -n -v --dbuser=asterisk

I get the error:

Could not determine Asterisk version (got: Unable to access the running directory (Permission denied). Changing to ‘/’ for compatibility.). Please report this.

And then:

Finished setting permissions
Generating default configurations…
Reloading FreePBX
Error(s) have occured, the following is the retrieve_conf output:
exit: 1
Exception: Unable to connect to Asterisk Manager from /var/lib/asterisk/bin/retrieve_conf, aborting in file /var/lib/asterisk/bin/retrieve_conf on line 11
Stack trace:

  1. Exception->() /var/lib/asterisk/bin/retrieve_conf:11

And finally, I:

fwconsole restart

And get:

Running FreePBX shutdown…

fclose(): 61 is not a valid stream resource

restart [-i|–immediate] [args1] … [argsN]

SELinux is disabled, and iptables is set to allow all incoming and outgoing connections by default and has no other settings assigned.

The docker container is running as --net=host --pid=host --privileged
How can I overcome this problem?

Adding: chmod 755 -rc /usr/sbin to the script has eliminated the first problem, but the second two remain.

There are a lot of finnicky things in docker and freepbx that make it unexpectedly difficult to make this work correctly.

I would suggest you will have more luck with FreePBX 14 and a reasonably recent Debian (something with PHP 5.6 or higher).

Note that Ubunut 16.x has changed a bunch of things regarding unixodbc, and I’m not sure if the documentation has been updated yet.

I was using FreePBX 13 + Centos 6 for intended compatibility with commercial modules.

Presumably FreePBX 14 + Centos 7 will also be compatible with commercial modules when it leaves beta.

Would the latter be a better option for Docker on Synology dsm 6?

However, I’m thinking that it may be better to run an official FreePBX distro on a VM on a new box entirely. Are there any gotchas for that sort of setup?

That will not work, 100% for sure. Docker doesn’t allow Zend to work properly.

Will Zend not work on Docker even with the container running --privileged --pid=host --net=host?

How about the VM option with an official distro - will commercial modules run on that?

A full VM, yes. KVM/libvirt, vmware, HyperV, yes. Things like OpenVZ, and other container-esque things cause no end of heartaches.