3

I am trying to get freeswitch working with docker. My goal is to pull a freeswitch image and turn it into a container and have it up and running quickly. My end goal is to have custom image to easily deploy a freeswitch setup without much effort. Ideas?

enigma
  • 31
  • 1
  • 3
  • > have custom image to easily deploy a freeswitch setup without much effort. This is a fairly broad goal. Are you just asking how to build a freeswitch image with your added custom configuration? Is there some reason something like https://github.com/BetterVoice/freeswitch-container doesn't work? – Andy Shinn May 15 '17 at 19:09
  • For now deploying freeswitch within docker would be a great step. That would get us to a good starting point. Once we are able to do that I think it would be great if we could deploy with custom configs. – enigma May 15 '17 at 19:14
  • Andy - I tried the link you sent me but ran into an issue with CIP=$(sudo docker inspect --format='{{.NetworkSettings.IPAddress}}' $CID) at that part of the guide. Dont know enough to move past it really – enigma May 15 '17 at 19:34
  • 1
    You seem to be asking a question about how to run a Docker container. You should post this at serverault.com instead. Also, in the future, no one can really help you if you just say "I have a problem". Without any error message, logs, or other output, how can we even know what might be happening? – Andy Shinn May 15 '17 at 19:36
  • Il ask at serverfault.com. I would have posted the problem I ran into but I didnt capture the logs/output so and only realized it would have been helpful after the fact. Thanks for replying. – enigma May 15 '17 at 19:39

2 Answers2

4

There's already an docker image with freeswitch pre-installed, all you need to do is run this command on terminal(if running FS in a container is really all you need):

CID=$(sudo docker run --name freeswitch -p 5060:5060/tcp -p 5060:5060/udp -p 5080:5080/tcp -p 5080:5080/udp -p 8021:8021/tcp -p 7443:7443/tcp -p 60535-65535:60535-65535/udp -v /home/ubuntu/freeswitch/conf:/usr/local/freeswitch/conf bettervoice/freeswitch-container:1.6.6)

To connect to your container use:
sudo docker exec -it freeswitch /bin/bash

The first command already open and forwards all the container's ports used by FS to your machine.
You can edit the dockerfile and create your own variation of the image if you like.

Source: https://github.com/BetterVoice/freeswitch-container

ArthurG
  • 335
  • 2
  • 11
  • 1
    @Enigma, if this answers your question, then click the little check-mark, to the left to mark it as the accepted answer. – ArthurG Jan 09 '18 at 16:35
1

Here is example of Dockerfile with default freeswitch configs to start from:

FROM alpine:latest
RUN apk --update --no-cache add freeswitch \ 
  freeswitch-sample-config \ 
  freeswitch-sounds-en-us-callie-8000
CMD ["freeswitch"]