Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

[Docker] Issues with custom modules on a foreign machine #2

Open
lezsakdomi opened this issue Apr 14, 2019 · 5 comments
Open

[Docker] Issues with custom modules on a foreign machine #2

lezsakdomi opened this issue Apr 14, 2019 · 5 comments

Comments

@lezsakdomi
Copy link

TL;DR: When I build docker-drachtio-freeswitch-mrf on top of drachtio/freeswitch-grpc:latest, I can't load GRPC-dependent modules.

What I've done:

# Clone upstream image's repo
git clone https://github.com/davehorton/docker-drachtio-freeswitch-mrf
cd docker-drachtio-freeswitch-mrf

# Change base to this repository's Dockerhub-hosted image
sed -s '/^FROM drachtio/drachtio-freeswitch-base:latest$/FROM drachtio/freeswitch-grpc:latest'

# (build it...)
docker build . -t my-freeswitch-mrf

# Run the newly built image
docker run -it --rm --net=host -v "../gcs_service_account_key.json":"/tmp/gcs_service_account_key.json" my-freeswitch-mrf freeswitch

When I try loading mod_audio_fork:

freeswitch@my-pc> load mod_audio_fork
2019-04-14 11:30:40.868283 [ERR] switch_xml.c:1310 Error including /usr/local/freeswitch/conf/autoload_configs/../mrcp_profiles/*.xml
2019-04-14 11:30:40.908289 [INFO] switch_time.c:1423 Timezone reloaded 1750 definitions

+OK Reloading XML
-ERR [module load file routine returned an error]

2019-04-14 11:30:40.968272 [CRIT] switch_loadable_module.c:1522 Error Loading module /usr/local/freeswitch/mod/mod_audio_fork.so
**/usr/local/freeswitch/mod/mod_audio_fork.so: cannot open shared object file: No such file or directory**

When I try loading mod_google_tts:

freeswitch@my-pc> load mod_google_tts
2019-04-14 11:42:26.648283 [ERR] switch_xml.c:1310 Error including /usr/local/freeswitch/conf/autoload_configs/../mrcp_profiles/*.xml
2019-04-14 11:42:26.688410 [INFO] switch_time.c:1423 Timezone reloaded 1750 definitions

+OK Reloading XML
-ERR [module load file routine returned an error]

2019-04-14 11:42:26.748412 [CRIT] switch_loadable_module.c:1522 Error Loading module /usr/local/freeswitch/mod/mod_google_tts.so
**/usr/local/freeswitch/mod/mod_google_tts.so: undefined symbol: _ZTVN6google5cloud12texttospeech2v112TextToSpeech4StubE**

I expect these to load successfully, or even be loaded automatically.

PS.: It's interesting that mod_audio_fork simply doesn't exists but mod_google_tts is just wrongly-linked.

@lezsakdomi
Copy link
Author

Maybe this kinda detailed issue can be reduced to "Docker build fails.", since I have a lot to fix when I try to build using docker build . -t drachtio/freeswitch-grpc.

@davehorton
Copy link
Collaborator

agree, I am in the middle of updating this from freeswitch 1.6 to 1.8 and have to work through some stuff. Will try to sort out this week

@lezsakdomi
Copy link
Author

lezsakdomi commented Apr 14, 2019

Thanks, I'd really appreciate it!

For folks coming here:

I couldn't make 1.6 running.

Dockerfile is full of bugs and it's better if you create a new one based on build.sh instead. You might keep the cleanups at the end of the loong RUN command.

Although build.sh fails on Debian Jessie and the Debian Wheezy docker image can't update anymore.

Changes needed in build.sh:

  • Install ca-certificates (for further git clones; won't hurt)
  • Install zlib1g-dev (needed by FreeSwitch)
  • Manage FreeSwitch to link against openssl 1.0.1 instead of a newer one (this is where I stuck)

PS. Adding ARG MAKEFLAGS to Dockerfile comes handy.

@davehorton
Copy link
Collaborator

for now, a docker build with mod_audio_fork only (no grpc) is available via

docker pull drachtio/drachtio-freeswitch-mrf:1.8-slim

This is based on drachtio/drachtio-freeswitch-base:1.8-slim

which is a working Dockerfile for freeswitch 1.8 that builds and includes mod_audio_fork.
That Dockerfile -- available at https://github.com/davehorton/docker-drachtio-freeswitch-base/tree/v1.8 -- is a better example to look at.

I still need to create a version that builds the grpc stuff, will do that this week. Those github projects will become the source for docker builds going forward, and I will be removing the one in this project

@davehorton
Copy link
Collaborator

and for building a native freeswitch 1.8 on debian stretch with mod_audio_fork, use this:

https://github.com/davehorton/ansible-role-fsmrf

The main task file gives a fairly easy-to-follow set of steps if you need to do it manually.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants