owt-server 构建docker镜像

416 阅读1分钟

owt-server项目 构建docker镜像

Owt-server 是MCU+SFU的webrtc的服务器。公司需要用到这个项目,docker hub找了4.3、5.0的镜像。都有一些bug,想根据官方的github 构建最新的 5.1.0版本的 docker镜像, 但编译成docker镜像的资料国内基本没有。

这个教程是根据owt-server的官方镜像编译docker镜像。

需要有一台美国、香港服务器。可以进行科学上网

生成开发调试镜像和只运行镜像

  • 安装 git

    sudo apt update && sudo apt install git
    
  • 下载项目:

    cd ~ && git clone https://github.com/open-webrtc-toolkit/owt-server.git
    
  • 安装docker:

    sudo apt install docker.io
    
  • 安装docker-compose

    sudo apt install docker-compose
    
  • 进入 docker 目录

    cd ~/owt-server/docker
    
  • 执行 build_docker_image.sh 脚本命令

    ./build_docker_image.sh owt
    
  • 脚本执行完成验证是否生成 owt:buildowt:run 两个镜像

    root@iZrj91vdswfcb292wkdkq6Z:~/owt-server/docker# docker images
    REPOSITORY                      TAG       IMAGE ID       CREATED             SIZE
    <none>                          <none>    98afb11955c8   6 minutes ago       1.44GB
    owt-server-conference-install   latest    19322f190839   About an hour ago   1.44GB
    owt-server                      latest    19322f190839   About an hour ago   1.44GB
    owt                             run       e07b47d0c651   About an hour ago   1.44GB
    owt                             build     c7c1c4fc75a6   About an hour ago   17.6GB
    ubuntu                          18.04     f9a80a55f492   6 months ago        63.2MB
    

owt:build:如果你想修改 OWT 源代码并进行调试,可以直接使用该镜像运行 OWT 服务。

owt:run :生成的 OWT 二进制文件的 OWT 运行环境 Docker 镜像,不包括源代码

如果不想编译,可以用我编译好现成的镜像。到2023年12月23号是全网最新的镜像

  • 运行时镜像

    docker pull yuhanghate/owt-server:5.1.0
    
  • 包括源码、调试环境镜像

    docker pull yuhanghate/owt-server-dev:5.1.0