第一步:在Ubuntu 22上安装Docker

sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt update
sudo apt install docker-ce
sudo systemctl status docker

设置不用sudo也能运行docker的方法

sudo usermod -aG docker ${USER}
su - ${USER}

这时运行 docker ps 应该就可以了.
参考网址:https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-22-04
第二步:运行freeswitch docker
没有轮子就造个轮子

mkdir freeswitch
cd freeswitch
vi Dockerfile

新建Dockerfile文件,输入以下内容

FROM ubuntu:latest
LABEL maintainer="Your Name <your.email@example.com>"

RUN apt-get update && apt-get install -y \
    build-essential \
    git \
    autoconf \
    automake \
    libtool \
    libncurses5-dev \
    wget \
    libjpeg-dev \
    zlib1g-dev \
    libsqlite3-dev \
    libssl-dev \
    libcurl4-openssl-dev \
    libpcre3-dev \
    libspeexdsp-dev \
    libldns-dev \
    libedit-dev \
    libopus-dev \
    libsndfile1-dev \
    liblua5.3-dev \
    libspandsp-dev

RUN git clone https://github.com/signalwire/freeswitch.git /usr/src/freeswitch

WORKDIR /usr/src/freeswitch

RUN ./bootstrap.sh -j
RUN ./configure --prefix=/usr/local/freeswitch
RUN make && make install

ENV PATH="/usr/local/freeswitch/bin:${PATH}"

EXPOSE 5060 5061 5080 5081

CMD ["freeswitch", "-nonat"]

运行以下命令构建Docker镜像:
docker build -t freeswitch . --build-arg http_proxy=socks5://192.168.4.64:10008 --build-arg https_proxy=socks5://192.168.4.64:10008
这将会基于Dockerfile中的内容构建一个名为freeswitch的Docker镜像。这个构建docker部分的参考了这个链接:https://juejin.cn/post/7288165091979853883
但是编译不成功.太费劲了.

这个是编译成功的,手动编译freeswitch过程见链接:https://const.net.cn/760.html

本文链接地址:https://const.net.cn/764.html

标签: none

添加新评论