首页 > 系统相关 >freeswitch on centos dockerfile模式

freeswitch on centos dockerfile模式

时间:2024-01-19 18:35:25浏览次数:32  
标签:centos devel yum usr && freeswitch docker dockerfile

 

概述

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

centos7 docker上编译安装fs的流程记录,本文使用dockerfile模式。

环境

docker engine:Version 24.0.6

centos docker:7

freeswitch:v1.6.20

dockerfile

创建空目录,创建dockerfile文件。

github访问经常失败,先下载好源码包,并将fs.1.6.20源码文件夹拷贝到目录下。

mkdir centos.7-fs.1.6.20

cd centos.7-fs.1.6.20

ls

dockerfile  freeswitch-1.6.20

 

dockerfile文件内容如下。

vi dockerfile

 

FROM centos:7

 

WORKDIR      /root

 

ADD ./freeswitch-1.6.20 /root/freeswitch

 

RUN cd /root/ \

    && yum -y update \

    && echo "signalwireusername" > /etc/yum/vars/signalwireusername \

    && echo "pat_signalwiretoken" > /etc/yum/vars/signalwiretoken \

    && yum install -y https://$(< /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 install -y autoconf automake libtool gcc-c++ ncurses-devel make zlib-devel libjpeg-devel yasm  nasm  libevent  libevent-devel \

    && yum install -y openssl-devel e2fsprogs-devel curl-devel pcre-devel speex-devel sqlite-devel mysql-devel \

    && yum install -y git ldns-devel libedit-devel lua-devel libsndfile-devel libshout-devel lame-devel \

    && yum install -y which tzdata ilbc2-devel opus-devel \

    # && git clone https://github.com/signalwire/freeswitch.git -bv1.6.20 freeswitch \

    && cd /root/freeswitch/ \

    && chmod 775 -R * \

    && sh support-d/prereq.sh \

    && ./bootstrap.sh -j \

    && ./configure \

    && make \

    && make install \

    && cd /root/freeswitch/src/mod/codecs/mod_ilbc \

    && make \

    && make install \

    && cd /root/freeswitch/src/mod/applications/mod_translate \

    && make \

    && make install \

    && ln -s /usr/lib64/ilbc2/libilbc.so.0 /usr/lib64/libilbc.so.0 \

    && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \

    && yum clean all \

    && rm -rf /var/cache/yum \

    && rm -rf /root/freeswitch \

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

 

# EXPOSE 5080

 

VOLUME ["/usr/local/freeswitch/conf", "/usr/local/freeswitch/log", "/usr/local/freeswitch/recordings", "/usr/local/freeswitch/sounds", "/usr/local/freeswitch/webapp"]

 

CMD /usr/local/freeswitch/bin/freeswitch -nonat -nosql -nonatmap -nocal -nort

镜像操作

制作镜像,注意命令最后一个参数是当前目录“.“。

sudo docker build -t 10.55.55.136:5000/zr/centos.7-fs.1.6.20-test:v1.0 .

[+] Building 768.1s (9/9) FINISHED                                                                                                                                                                               docker:default

 => [internal] load .dockerignore                                                                                                                                                                                          0.2s

 => => transferring context: 2B                                                                                                                                                                                            0.0s

 => [internal] load build definition from dockerfile                                                                                                                                                                       0.1s

 => => transferring dockerfile: 2.03kB                                                                                                                                                                                     0.0s

 => [internal] load metadata for docker.io/library/centos:7                                                                                                                                                                0.0s

 => [1/4] FROM docker.io/library/centos:7                                                                                                                                                                                  0.0s

 => [internal] load build context                                                                                                                                                                                          2.3s

 => => transferring context: 190.73MB                                                                                                                                                                                      2.0s

 => CACHED [2/4] WORKDIR /ROOT                                                                                                                                                                                             0.0s

 => [3/4] ADD ./freeswitch-1.6.20 /root/freeswitch                                                                                                                                                                         1.7s

 => [4/4] RUN cd /root/     && yum -y update     && echo "signalwireusername" > /etc/yum/vars/signalwireusername     && echo "pat_signalwiretoken" > /etc/yum/vars/signalwiretoken     && yum install -y https://$(<   757.8s

 => exporting to image                                                                                                                                                                                                     5.5s

 => => exporting layers                                                                                                                                                                                                    5.5s

 => => writing image sha256:a0a8c5564ad901bc931d9610169b3388f60e07d2201f846d9c35a8603b880e69                                                                                                                               0.0s

 => => naming to 10.55.55.136:5000/zr/centos.7-fs.1.6.20-test:v1.0                                                                                                                                                         0.0s

 

上传镜像到registry。

sudo docker images

sudo docker push 10.55.55.136:5000/zr/centos.7-fs.1.6.20-test:v1.0

 

下载镜像。

sudo docker pull 10.55.55.136:5000/zr/centos.7-fs.1.6.20-test:v1.0

 

查看私服registry的镜像版本。

curl -XGET http://10.55.55.136:5000/v2/_catalog

{"repositories":["test/debian","test/registry","zr/centos.7-fs.1.6.19-compile","zr/centos.7-fs.1.6.19-release"]}

 

curl -XGET http://10.55.55.136:5000/v2/zr/centos.7-fs.1.6.19-release/tags/list

{"name":"zr/centos.7-fs.1.6.19-release","tags":["v1.1","v1.2","v1.3","v1.4","v1.5","v1.6"]}

问题处理

DOCKER使用过程问题汇总。

1, docker容器的时区设置问题,在容器中执行如下命令。

yum install tzdata

cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2, 运行一个无日志的Docker容器。

docker run -d --log-driver none your_image_name

3, docker容器访问宿主机上nas目录的状态,取决于docker服务启动时宿主机挂载nas目录的状态。

所以,nas挂载目录有变化的时候,需要重启docker服务,以便docker容器可以正常访问nas目录。

4, docker容器自动重启。

docker run -d --restart=always your_image_name

总结

centos系统后续的维护问题需要关注。

centos和rocky的方向需要验证和抉择一下。

 

空空如常

求真得真

标签:centos,devel,yum,usr,&&,freeswitch,docker,dockerfile
From: https://www.cnblogs.com/qiuzhendezhen/p/17975327

相关文章

  • centOS7安装GLPI 和fusioninventory插件
    centOS7安装GLPI,一、关闭防火墙(不关闭只能本机访问):systemctlstopfirewalld.service#停止firewalld服务systemctldisablefirewalld.service#设置开机默认不启动#生产环境单独在防火墙上开启端口和策略#firewall-cmd--permanent--zone=public--add-port=80/tcp#firewa......
  • 从网上摘的Docker在CentOS7.X安装过程
    cd/etc/systemd/system/touchdocker.servicevidocker.service---------------------[Unit]Description=DockerApplicationContainerEngineDocumentation=https://docs.docker.comAfter=network-online.targetfirewalld.serviceWants=network-online.target[Service]Ty......
  • centos设置时间同步
    安装NTPyum-yinstallntp设置NTP服务器ntpdatentp3.aliyun.com测试date......
  • centos系统安装
    CentOS系统介绍CentOS操作系统是Linux系统的一个发行版。Linux操作系统,全称GNU/Linux,是一种免费使用和自由传播的类UNIX操作系统,其内核由林纳斯·本纳第克特·托瓦兹于1991年10月5日首次发布,它主要受到Minix和Unix思想的启发,是一个基于POSIX和Unix的多用户、多任务、支持多线......
  • Centos离线以安装包形式安装gcc等软件
    安装软件下载以下安装包由于rpm包之间存在一定依赖关系,所以使用rpm-ivh*.rpm可能安装失败方案一:按照依赖关系按顺序一个个安装rpm-ivhmpfr-3.1.1-4.el7.x86_64.rpmrpm-ivhlibmpc-1.0.1-3.el7.x86_64.rpmrpm-ivhkernel-headers-3.10.0-1160.el7.x86_64.rpmrpm-ivhglib......
  • centos7.9(大部分都可以)和redhat6.9 离线升级OpenSSH和openssl (2023年的版本)
     ssl 红色。测试centos7.6也可以升级注意事项!1、多开几个连接窗口(xshell),避免升级openssh失败无法再次连接终端,否则要跑机房了。2、可开启telnet服务、vnc服务、打快照。多几个“保命”的路数。一、centos7.9的信息[root@node2~]#opensslversionOpenSSL1.0.2k-fips......
  • centos 服务器buffer/cache缓存占用太大
    修改服务器此相关的参数在/proc/sys/vm目录下 vm.min_free_kbytes=409600;vm.vfs_cache_pressure=200;vm.swappiness=40。调整MIN_FREE_KBYTES的目的是保持物理内存有足够的空闲空间,防止突发性的换页。swapiness缺省为60,减少swapiness会使系统尽快通过swapout不使用的进程资源......
  • 基于centos环境的docker安装redis以及设置密码
    本篇的博客是因为之前的博客,写的存在问题,设置的密码无法使用,就是即使设置了密码,依旧提示认证失败,所以才有了本篇的博客文章 dockerpullredis 查看下载的镜像dockerimages新建redis配置文件mkdir-p/home/redis/conftouch/home/redis/conf/redis......
  • Docker系列---【CentOS7在线安装docker】
    1.什么是Docker?docker叫做虚拟化技术,也叫作容器化技术.简单来说就是服务器版,高性能版的linux系统(Ubuntu和centos7以上版本才能运行docker)的虚拟机.2.Docker作用可以通过docker虚拟化技术,来在一台真实的服务器上构建很多,虚拟服务器,因为一般在企业一台真实服务器分配......
  • centos7中安装R
     方法1,从外源库中安装001、系统[root@PC1home]#cat/etc/redhat-release##系统,centos7.6CentOSLinuxrelease7.6.1810(Core) 002、测试R[root@PC1home]#R##测试Rbash:R:commandnotfound... 003、安装e......