yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo http://download.docker.com/linux/centos/docker-ce.repo 或 yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum list docker-ce --showduplicates | sort -r
5)安装docker服务
yum install docker-ce-cli-23.0.6 docker-ce-23.0.6 containerd.io
查看docker版本信息:
6)配置docker服务
也可通过wget获取:
wget https://files.freeswitch.org/releases/freeswitch/freeswitch-1.10.9.-release.tar.gz
wget https://github.com/signalwire/libks/archive/refs/tags/v1.8.2.tar.gz wget https://github.com/freeswitch/sofia-sip/archive/refs/tags/v1.13.14.tar.gz git clone https://github.com/freeswitch/spandsp.git wget https://github.com/signalwire/signalwire-c/archive/refs/tags/1.3.0.tar.gz
docker image pull debian:bullseye
docker run --name debian --network host -t -d debian:bullseye
2)复制源码到debian容器
docker cp freeswitch-1.10.9.-release.tar.gz debian:/usr/src/ docker cp fs1.10.9-deps debian:/usr/src/
3)更新apt源(可选)
>/etc/apt/sources.list echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free" >> /etc/apt/sources.list echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free" >> /etc/apt/sources.list echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free" >> /etc/apt/sources.list echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free" >> /etc/apt/sources.list cat /etc/apt/sources.list apt update
4)安装编译依赖项
apt install gcc g++ autoconf automake make cmake yasm uuid-dev libvpx-dev unixodbc-dev ncurses-dev zlib1g-dev libjpeg-dev libtiff-dev liblua5.1-0-dev libsqlite3-dev libsndfile-dev libavformat-dev libswscale-dev libcurl4-openssl-dev libpcre3-dev libspeex-dev libspeexdsp-dev libedit-dev libtool libldns-dev libopus-dev libpq-dev
tar zxvf libks-1.8.2.tar.gz cd libks-1.8.2 cmake . make make install
tar zxvf sofia-sip-1.13.14.tar.gz cd sofia-sip-1.13.14 ./bootstrap.sh ./configure make make install
cd spandsp/ ./bootstrap.sh ./configure make make install export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:${PKG_CONFIG_PATH} echo "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:${PKG_CONFIG_PATH}" >> /etc/profile ldconfig
tar zxvf signalwire-c-1.3.0.tar.gz cd signalwire-c-1.3.0 cmake . make make install
./rebootstrap.sh && ./configure && make
运行FreeSWITCH:
rm -rf /usr/src/freeswitch-1.10.9.-release* rm -rf /usr/src/fs1.10.9-deps/
docker export -o debian_fs_builder.tar 164f8b171a95
3)给导出的容器快照添加标签
docker import debian_fs_builder.tar docker image tag 91f9e45241ed fs:base
4)导出基础编译镜像
docker image save fs:base -o fs-base.tar tar zcvf fs-base.tar.gz fs-base.tar
预编译的基础镜像(fs-base.tar.gz)可从如下渠道获取:
docker load -i fs-base.tar
2)启动容器
docker run --name fs --network host -t -d fs:base /bin/bash
3)编译及运行FreeeSWITCH
#! /bin/bash tar zxvf freeswitch-1.10.9.-release.tar.gz docker build -t fs:1.0.0 . docker image save fs:1.0.0 -o fs_v1.0.0.tar tar zcvf fs_v1.0.0.tar.gz fs_v1.0.0.tar rm -rf fs_v1.0.0.tar
tar zxvf fs_v1.0.0.tar.gz docker load -i fs_v1.0.0.tar ./run.sh
使用基础编译镜像自动构建版本及运行容器的演示视频,可从如下渠道获取: