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
使用基礎編譯映象自動構建版本及執行容器的演示視訊,可從如下渠道獲取: