The "flexisip/docker"
directory contains specific instructions for building the flexisip image from source within a development environment using Debian 10. Within the GitLab (or GitHub) repository, the "flexisip/docker" directory includes Dockerfiles that allow you to set up development environments tailored to various Linux distributions. It also contains Dockerfiles for creating images that install the Flexisip package built from source.
Building the development environment image when compiling Flexisip from source code
The "flexisip/docker" directory provides preconfigured Dockerfiles (bc-dev-*) for various distributions like Debian, Ubuntu, Rocky Linux, and Arch Linux. Using these Dockerfiles, you can create a development environment image tailored to the specific distribution you choose. With this image, you can then work within a container to build Flexisip from its source code.
The Makefile includes commands for building the Flexisip image ("flexisip") from source using "flex-from-src" or from a Debian package using "flex-from-deb". You can reference these commands as examples and modify them accordingly, specifying the appropriate Dockerfile for your chosen distribution, to create the Flexisip image.
Please note that this process involves selecting the relevant Dockerfile, creating the development environment image, and then using it to build and work with Flexisip from its source code.
ex) Creating a Development Environment Image from bc-dev-ubuntu-22-04
$ docker build -f bc-dev-ubuntu-22-04 -t bc-dev-ubuntu:22-04 --rm .
or
$ docker build -f bc-dev-ubuntu-22-04 --pull --no-cache -t bc-dev-ubuntu:22-04 --rm .
Launching a Development Environment Container from the above image (execute in the $PWD:flexisip source directory)
$ docker run --name flexisip-sdk -v $PWD:/home/bc -it bc-dev-ubuntu:22-04 bash
Build in the above container
# mkdir build
# cd build
# cmake .. -DCMAKE_INSTALL_PREFIX=/opt/belledonne-communications -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSYSCONF_INSTALL_DIR=/etc -DCPACK_GENERATOR=DEB
# make package
Creating a Docker Image for the Latest Stable Version of Flexisip
By adding the Belledonne Communications repository to your apt source list, you can install the latest stable version of Flexisip. It's recommended to use the latest stable version installed from the repository for purposes other than trying out alpha or beta versions during development, or for customization and operational use, instead of building Flexisip from source.
To run Flexisip using the latest stable version added through the Belledonne Communications APT repository, you can create a Dockerfile named 'flex-from-ubuntu-apt-repo' referencing the Dockerfile 'flex-from-deb' which installs the Flexisip package built from source. This new Dockerfile should include the addition of the Belledonne Communications APT repo and is tailored for Ubuntu 22.04.
flex-from-ubuntu-apt-repo
FROM ubuntu:22.04
MAINTAINER Takanobu Fuse <[email protected]>
# Prepare dependencies
RUN apt-get update
RUN apt-get install -y nano xsdcxx gdb libmariadb3 snmp-mibs-downloader snmp snmpd iproute2 iptables wget gnupg2
RUN echo 'deb [arch=amd64] http://linphone.org/snapshots/ubuntu jammy stable' > /etc/apt/sources.list.d/belledonne.list
RUN wget https://www.linphone.org/snapshots/ubuntu/pubkey.gpg -O - | apt-key add -
RUN apt-get update && apt-get install -y bc-flexisip
# Add it to the default path
ENV PATH=$PATH:/opt/belledonne-communications/bin
WORKDIR /opt/belledonne-communications
# Generate a default configuration
RUN flexisip --dump-default all > /etc/flexisip/flexisip.conf
VOLUME /etc/opt/belledonne-communications/flexisip
VOLUME /var/opt/belledonne-communications/log/flexisip
COPY flexisip-entrypoint.sh /
COPY backtrace.gdb /
RUN chmod a+x /flexisip-entrypoint.sh
# Script to wait db before launch flexisip [Licence Apache2]
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.2.1/wait /wait
RUN chmod +x /wait
ENTRYPOINT ["/flexisip-entrypoint.sh"]
CMD flexisip
Creating an Image File with the Latest Stable Version of Flexisip Installed from the above Dockerfile
$ docker build -f flex-from-ubuntu-apt-repo --pull --no-cache -t flex-from-ubuntu-apt-repo:22.04 --rm .
Launching a Flexisip Container from the Image File created above
$ docker run -d --network host --name ubuntu-flexisip-repo flex-from-ubuntu-apt-repo:22.04 --server proxy
I will provide corrections, additions, and other related matters on the forum mentioned below (Japanese Only)