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

**URL:** <https://community.freepbx.org/t/update-docker-file-freepbx-12-0-3-and-asterisk-13-1-install-works/27113>\
**Category:** Installation / Upgrade\
**Created:** [February 4, 2015, 10:20pm UTC](https://community.freepbx.org/t/update-docker-file-freepbx-12-0-3-and-asterisk-13-1-install-works/27113 "2015-02-04T22:20:38Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbrown](https://community.freepbx.org/letter_avatar_proxy/v4/letter/m/e68b1a/32.png) [@mbrown](https://community.freepbx.org/u/mbrown)\
**Post date:** [February 4, 2015, 10:20pm UTC](https://community.freepbx.org/t/update-docker-file-freepbx-12-0-3-and-asterisk-13-1-install-works/27113/1 "2015-02-04T22:20:39Z")

</div>

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](http://wiki.freepbx.org/pages/viewpage.action?pageId=1409028)

i used it as a base to make a dockerfile:

> <https://github.com/Brownster/asterisk-freepbx/blob/master/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

---

<div class="post-metadata">

**Author:** ![mbrown](https://community.freepbx.org/letter_avatar_proxy/v4/letter/m/e68b1a/32.png) [@mbrown](https://community.freepbx.org/u/mbrown)\
**Post date:** [February 4, 2015, 10:56pm UTC](https://community.freepbx.org/t/update-docker-file-freepbx-12-0-3-and-asterisk-13-1-install-works/27113/2 "2015-02-04T22:56:53Z")

</div>

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

> [@Debian Wheezy + FreePBX 12 + Asterisk 13.1.0 How-To (mostly working with warnings)](http://community.freepbx.org/t/debian-wheezy-freepbx-12-asterisk-13-1-0-how-to-mostly-working-with-warnings/26845):
>
> Hello, Here’s an attempt at writing a how-to on installing FreePBX 12 on Debian Wheezy with Asterisk 13.1. It currently works as is, but I would like to request the help of the community for a review and comments on a couple of errors I’m getting. This is mostly based on freepbx wiki articles on installing FreePBX 2.11 on wheezy and FreePBX 12 on Ubuntu 14.10. So here we go: FreePBX 12 + Asterisk 13 on Debian Wheezy How-To Install Debian Stable Use a netinst ISO Configure partitioning layout …

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**

---

<div class="post-metadata">

**Author:** ![tm1000](https://community.freepbx.org/user_avatar/community.freepbx.org/tm1000/32/30227_2.png) [@tm1000](https://community.freepbx.org/u/tm1000)\
**Post date:** [February 5, 2015, 7:32am UTC](https://community.freepbx.org/t/update-docker-file-freepbx-12-0-3-and-asterisk-13-1-install-works/27113/3 "2015-02-05T07:32:08Z")

</div>

```
ENV FREEPBXVER 12.0.3

```

Is way too old. Always make sure to review [http://www.freepbx.org/download-freepbx](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”

---

<div class="post-metadata">

**Author:** ![mbrown](https://community.freepbx.org/letter_avatar_proxy/v4/letter/m/e68b1a/32.png) [@mbrown](https://community.freepbx.org/u/mbrown)\
**Post date:** [February 5, 2015, 7:03pm UTC](https://community.freepbx.org/t/update-docker-file-freepbx-12-0-3-and-asterisk-13-1-install-works/27113/4 "2015-02-05T19:03:56Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![mbrown](https://community.freepbx.org/letter_avatar_proxy/v4/letter/m/e68b1a/32.png) [@mbrown](https://community.freepbx.org/u/mbrown)\
**Post date:** [February 6, 2015, 10:45am UTC](https://community.freepbx.org/t/update-docker-file-freepbx-12-0-3-and-asterisk-13-1-install-works/27113/5 "2015-02-06T10:45:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mbrown](https://community.freepbx.org/letter_avatar_proxy/v4/letter/m/e68b1a/32.png) [@mbrown](https://community.freepbx.org/u/mbrown)\
**Post date:** [February 6, 2015, 12:24pm UTC](https://community.freepbx.org/t/update-docker-file-freepbx-12-0-3-and-asterisk-13-1-install-works/27113/6 "2015-02-06T12:24:40Z")

</div>

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

[https://registry.hub.docker.com/u/brownster/freepbx12021/](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.

---

<div class="post-metadata">

**Author:** ![mbrown](https://community.freepbx.org/letter_avatar_proxy/v4/letter/m/e68b1a/32.png) [@mbrown](https://community.freepbx.org/u/mbrown)\
**Post date:** [February 6, 2015, 11:32pm UTC](https://community.freepbx.org/t/update-docker-file-freepbx-12-0-3-and-asterisk-13-1-install-works/27113/7 "2015-02-06T23:32:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tm1000](https://community.freepbx.org/user_avatar/community.freepbx.org/tm1000/32/30227_2.png) [@tm1000](https://community.freepbx.org/u/tm1000)\
**Post date:** [February 7, 2015, 6:12am UTC](https://community.freepbx.org/t/update-docker-file-freepbx-12-0-3-and-asterisk-13-1-install-works/27113/8 "2015-02-07T06:12:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mbrown](https://community.freepbx.org/letter_avatar_proxy/v4/letter/m/e68b1a/32.png) [@mbrown](https://community.freepbx.org/u/mbrown)\
**Post date:** [February 7, 2015, 2:23pm UTC](https://community.freepbx.org/t/update-docker-file-freepbx-12-0-3-and-asterisk-13-1-install-works/27113/9 "2015-02-07T14:23:08Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![tm1000](https://community.freepbx.org/user_avatar/community.freepbx.org/tm1000/32/30227_2.png) [@tm1000](https://community.freepbx.org/u/tm1000)\
**Post date:** [February 7, 2015, 8:52pm UTC](https://community.freepbx.org/t/update-docker-file-freepbx-12-0-3-and-asterisk-13-1-install-works/27113/10 "2015-02-07T20:52:40Z")

</div>

> [@mbrown](#):
>
> 10000-10099

That should be 10000-20000

> [@mbrown](#):
>
> in most of the guides it used at least once sometimes twice is it needed?

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

---

<div class="post-metadata">

**Author:** ![mbrown](https://community.freepbx.org/letter_avatar_proxy/v4/letter/m/e68b1a/32.png) [@mbrown](https://community.freepbx.org/u/mbrown)\
**Post date:** [February 8, 2015, 6:42pm UTC](https://community.freepbx.org/t/update-docker-file-freepbx-12-0-3-and-asterisk-13-1-install-works/27113/11 "2015-02-08T18:42:31Z")

</div>

> [@tm1000](#):
>
> That should be 10000-20000

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.

> [@tm1000](#):
>
> Yes, just to make sure everything really did get installed.

I will give it run with installall included.

Thanks

---

<div class="post-metadata">

**Author:** ![mbrown](https://community.freepbx.org/letter_avatar_proxy/v4/letter/m/e68b1a/32.png) [@mbrown](https://community.freepbx.org/u/mbrown)\
**Post date:** [February 8, 2015, 10:29pm UTC](https://community.freepbx.org/t/update-docker-file-freepbx-12-0-3-and-asterisk-13-1-install-works/27113/12 "2015-02-08T22:29:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tm1000](https://community.freepbx.org/user_avatar/community.freepbx.org/tm1000/32/30227_2.png) [@tm1000](https://community.freepbx.org/u/tm1000)\
**Post date:** [February 9, 2015, 4:58pm UTC](https://community.freepbx.org/t/update-docker-file-freepbx-12-0-3-and-asterisk-13-1-install-works/27113/13 "2015-02-09T16:58:10Z")

</div>

> [@mbrown](#):
>
> ISSUE 2, - issue with framework modified… FIX:amportal a ma update framework
> 
> Issue 3, unsigned moduleFIX: amportal chownamportal a ma refreshsignaturesamportal a reload

Dont checkout from git. Download the tarball instead.
