龙空技术网

fs.1.10 ON CENTOS7 docker镜像制作

求真得真 83

前言:

现时兄弟们对“centos6docker最新版”大体比较看重,大家都需要剖析一些“centos6docker最新版”的相关内容。那么小编同时在网上网罗了一些关于“centos6docker最新版””的相关知识,希望咱们能喜欢,各位老铁们快快来了解一下吧!

概述

freeswitch是一款简单好用的VOIP开源软交换平台。

centos7 docker上编译安装fs1.10版本的流程记录。

环境

docker engine:Version 24.0.6

centos docker:7

freeswitch:v1.10.7

手动模式centos准备

docker hub拉取centos镜像。

sudo docker pull centos:7

启动docker容器,版本使用centos7。

sudo docker run -itd --name centos.7-fs.1.10-compile centos:7

sudo docker exec -it centos.7-fs.1.10-compile bash

以下步骤均为docker容器“centos.7-fs.1.10-compile”内部操作。

安装scl工具,必选安装

系统更新

yum update -y

官方scl源

yum install -y centos-release-scl centos-release-scl-rh

yum install -y scl-utils scl-utils-build yum-utils

yum repolist && yum clean all && yum makecache

从scl源中搜索软件,可选安装

yum search devtoolset-9-gcc

yum install -y devtoolset-9-gcc

scl enable devtoolset-9 'bash'

scl --list

通过bash环境来设定,仅对特定用户启用,可选

vi ~/.bashrc # or ~/.bash_profile

source scl_source enable devtoolset-9

安装libav,可选安装(不编译mod_av的情况下)

mod_av 依赖libav, libav需要 x264 lib才能支持h264

## download and install libx264

wget -c

tar -jxvf libx264.tar.bz2

cd libx264

./configure --enable-static --enable-shared --prefix=/usr

make

make install

cp /usr/lib/pkgconfig/x264.pc /usr/lib64/pkgconfig/

cp /usr/lib/libx264.so /usr/lib64/

cp /usr/lib/libx264.a /usr/lib64/

## download and install libav

wget -c

tar -jxvf libav-12.tar.bz2

cd libav

./configure --enable-pic --enable-shared --enable-libx264 --enable-gpl --extra-libs="-ldl" --extra-cflags=-I/usr/include --extra-ldflags=-L/usr/lib64

make # make CXXFLAGS="-fPIC"

make install

cp /usr/local/lib/pkgconfig/libavcodec.pc /usr/local/lib/pkgconfig/libavdevice.pc /usr/local/lib/pkgconfig/libavfilter.pc /usr/local/lib/pkgconfig/libavformat.pc /usr/local/lib/pkgconfig/libavresample.pc /usr/local/lib/pkgconfig/libavutil.pc /usr/local/lib/pkgconfig/libswscale.pc /usr/lib64/pkgconfig/

## 执行刷新,以让FreeSWITCH运行时可以找到库

ldconfig

编译安装freeswitch,删除mod_av模块编译

yum源

echo "signalwire" > /etc/yum/vars/signalwireusername

echo "TOKEN" > /etc/yum/vars/signalwiretoken

yum install -y (< /etc/yum/vars/signalwireusername):$(< /etc/yum/vars/signalwiretoken)@freeswitch.signalwire.com/repo/yum/centos-release/freeswitch-release-repo-0-1.noarch.rpm

yum install -y epel-release

yum clean all

yum makecache fast

依赖

yum install -y yum-utils

yum-builddep -y freeswitch --skip-broken

yum install -y yum-plugin-ovl rpmdevtools yum-utils git centos-release-scl centos-release-scl-rh

yum remove spandsp-devel spandsp

yum install -y sofia-sip-devel spandsp3-devel libks signalwire-client-c erlang python-devel postgresql-devel

编译

git clone -b v1.10.7 freeswitch-1.10.7

cd freeswitch-1.10.7

##vi configure.ac 删除mod_av行

rm -rf /root/freeswitch-1.10.7/src/mod/applications/mod_av

chmod 777 -R *

./bootstrap.sh -j

##./configure --enable-portable-binary --with-gnu-ld --with-python --with-erlang --with-openssl --enable-core-odbc-support --enable-zrtp

./configure

cd /root/freeswitch-1.10.7/src/mod/codecs/mod_g729/

make

cd -

make

安装

make -j install

make -j cd-sounds-install

make -j cd-moh-install

清理多余的文件。

yum clean all

package-cleanup --quiet --leaves | xargs yum remove -y

package-cleanup --quiet --dupes | xargs yum remove -y

rm -rf /var/cache/yum

rm -rf /root/freeswitch-1.10.7

rm -rf /usr/local/freeswitch/conf /usr/local/freeswitch/log /usr/local/freeswitch/recordings

镜像操作

制作镜像。

sudo docker commit -m="centos.7-fs.1.10-release" -a="zr" centos.7-fs.1.10-compile 10.55.55.136:5000/zr/centos.7-fs.1.10-release:v1.1

上传镜像到registry。

sudo docker images

sudo docker push 10.55.55.136:5000/zr/centos.7-fs.1.10-release:v1.1

下载镜像。

sudo docker pull 10.55.55.136:5000/zr/centos.7-fs.1.10-release:v1.1

启动容器release。

sudo docker run -itd --net=host -v /home/adminx/docker/centos.7-fs.1.6.19/fs-sbc/conf:/usr/local/freeswitch/conf -v /usr/local/freeswitch/log:/usr/local/freeswitch/log -v /usr/local/freeswitch/recordings:/usr/local/freeswitch/recordings --name centos.7-fs.1.10-sbc 10.55.55.136:5000/zr/centos.7-fs.1.10-release:v1.1 /usr/local/freeswitch/bin/freeswitch -nonat -nosql -nonatmap -nocal -nort

sudo docker logs centos.7-fs.1.10-sbc

sudo docker exec -it centos.7-fs.1.10-sbc /usr/local/freeswitch/bin/fs_cli -x status

sudo docker rm -f centos.7-fs.1.10-sbc

总结

fs.1.10版本比1.6版本的安装依赖要更多,最终产生的镜像大小也更大。

后续继续整理fs.1.10镜像的dockerfile模式。

空空如常

求真得真

标签: #centos6docker最新版