**UPDATE** Docker file FREEPBX 12.0.3 and ASTERISK 13.1 install Works!

Hi all,

I have an issue with installing FreePBX using this guide and hit a dead end:

http://wiki.freepbx.org/pages/viewpage.action?pageId=1409028

i used it as a base to make a dockerfile:

which builds fine up to:

amportal a ma installall

it gets part way through and i get:

Untaring…Done
Module webrtc successfully downloaded
Module webrtc successfully installed
Done. All modules installed.

SETTING FILE PERMISSIONS…Done
Removing any dangling symlinks
Dangling symlinks removed
/var/lib/asterisk/bin/freepbx_engine: line 734: syntax error near unexpected token (' /var/lib/asterisk/bin/freepbx_engine: line 734: Usermanager Specific Operations (requires root) (Type ‘amportal a userman’ to see more)’

anyone have any ideas how i can resolve this?

Thanks

Marc

I have got a bit further by editing the freepbx build order slightly to match what this user:

had put and restarting asterisk in between commands but now i am getting a php error

SETTING FILE PERMISSIONS…Done
Removing any dangling symlinks
Dangling symlinks removed

Please wait…

Upgrading: callrecording, cdr, core, dashboard, featurecodeadmin, framework, infoservices, sipsettings, voicemail
Upgrading callrecording…
Downloading 33087 of 33087 (100%)

Untaring…Done
Module callrecording successfully downloaded
PHP Fatal error: Cannot redeclare callrecording_destinations() (previously declared in /tmp/freepbx/amp_conf/htdocs/admin/modules/callrecording/functions.inc.php:16) in /var/www/html/admin/modules/callrecording/functions.inc.php on line 29

ENV FREEPBXVER 12.0.3

Is way too old. Always make sure to review http://www.freepbx.org/download-freepbx

./install_amp --update-links 1>/dev/null \

This is a development setting. You are confusing the system by running this when not in development mode, Which is why you are having the Fatal error, because you have half symlinked files and half copied files.

--skip-module-install

Not sure why set this flag then later run through installing them manually each one-by-one. Just dont set this flag and get rid of your “ma installs”

1 Like

@tm1000 thanks a lot for the feedback, i will make those changes you suggested, after a bit more playing last night i got the docker file to build successfully haven’t had time to test it yet though.

I am getting there slowly, i want to tidy up the docker file by specifying some mount points.

If i want the freepbx setup/config to survive between containers i need to map some folders to be external of the container. My question is what folders are important to freepbx as regards to setup/config, so i can mnt external folders to those points and have the freepbx config external to the container.

Thanks for the help

Marc

the docker file with @tm100 suggestions has successfully built you can find the image here:

https://registry.hub.docker.com/u/brownster/freepbx12021/

Not had chance to test it yet

I have decided to just mnt as backup directory so it is easy to backup freepbx to a folder outside the container.

2 Likes

Hello,

I have tried to run the container and i have hit a problem asterisk is running no probs but i have no web interface running amportal reload produces an error complaining /etc/asterisk doesnt exist when it does see below:

root@lucy-Laptop:/etc/asterisk# ls
asterisk.conf freepbx_menu.conf.template meetme_additional.conf phpagi.conf vm_email.inc
cdr.conf freepbx_module_admin.conf meetme_general_additional.conf privacy.conf vm_general.inc
cdr_mysql.conf indications.conf meetme_general_custom.conf queues.conf voicemail.conf
cdr_mysql.conf.bak manager.conf modem.conf queues_additional.conf voicemail.conf.template
chan_dahdi.conf.template manager.conf.12.0.1.bak modules.conf queues_custom.conf zapata.conf.template
enum.conf manager.conf.bak musiconhold.conf queues_custom_general.conf
extensions_additional.conf manager_additional.conf musiconhold_additional.conf queues_general_additional.conf
extensions_custom.conf.sample manager_custom.conf musiconhold_custom.conf queues_post_custom.conf
freepbx_featurecodes.conf.template meetme.conf phone.conf version
root@lucy-Laptop:/etc/asterisk# amportal reload

Please wait…
/usr/local/sbin/amportal: line 49: [FATAL]: command not found

/var/lib/asterisk/bin/freepbx_engine: line 100: [FATAL]: command not found
**** WARNING: ERROR IN CONFIGURATION ****
astrundir in ‘/etc/asterisk’ is set to but the directory
does not exists. Attempting to create it with: 'mkdir -p ’

mkdir: missing operand
Try ‘mkdir --help’ for more information.
**** ERROR: COULD NOT CREATE ****
Attempt to execute 'mkdir -p ’ failed with an exit code of 1
You must create this directory and the try again.
root@lucy-Laptop:/etc/asterisk#

anyone have an idea why it would think it doesn’t exist when it does?

Thanks

Marc

That error is not releated to what you think at all. The reality is amportal can’t connect to the database.

@tm1000 again thanks for the reply its appreciated, i will run a container later and make sure mysql is running.

I do have a question regarding:

amportal a ma installall

in most of the guides it used at least once sometimes twice is it needed?

I have made some changes to the docker file to expose ports 5060 80 and 10000-10099, i think that’s all the ports i need.

That should be 10000-20000

Yes, just to make sure everything really did get installed.

rather than opening up 10000 ports i was hoping to edit rtp conf to reduce the amount of ports to a hundred as it will be for home use / testing maybe even further down the road get the docker file to edit rtp.conf whilst building the image.

I will give it run with installall included.

Thanks

so i have freepbx running in a docker container and it seems happy now, i had a couple of errors on first login to freepbx but they were easy to resolve i didn’t make a note of the actual errors i will next time i run the container but in summary they were:

Issue 1, - complaining of access…
FIX:
vi /etc/apache2/sites-enabled/000-default" and hit Return / Enter.
At Directory /var/www/ you’ll see a line like the following:
“AllowOverride None” - change this to “AllowOverride ALL”.

then press esc
type
:wq
press enter

ISSUE 2, - issue with framework modified…
FIX:
amportal a ma update framework

Issue 3, unsigned module
FIX:
amportal chown
amportal a ma refreshsignatures
amportal a reload

Are these common warnings to get? Any suggestions on how i can prevent them?

If you would like to try just install docker if dont already have it and run from the host cmd line:

sudo docker run --name freepbx -v /place/to/put/backup:/etc/freepbxbackup --net=host -d -t brownster/freepbx12021

Dont checkout from git. Download the tarball instead.