Getting Started with Open Visual Cloud Dockerfiles
What is Docker and Dockerfiles?
Docker is an application that makes it simple and easy to run application processes in a container. Dockerfiles build server images automatically by reading instructions - a text file that contains all commands, in order, needed to build a given image. An image is an executable package that includes everything needed to run an application - the code, a runtime, libraries, environment variables, and configuration files.
In the case of the Open Visual Cloud, a Dockerfile builds an image configuring all the open source building blocks needed to construct a services pipeline. For example, the FFmpeg Dockerfile contains commands to install, build, and run a FFmpeg image optimized with Scalable Video Technology (SVT). The Dockerfile installs a variety of codecs like aac, mp3, SVT-AV1. Without using a Dockerfile, these install, build, and run commands would have to be entered into the command line manually. Now, just by loading a single Dockerfile, a server image optimized for visual cloud services can be created simply.
How to Install Docker and run an Open Visual Cloud Dockerfile
Install Docker Community Edition (CE):
Set up Docker proxy:
(1) sudo mkdir -p /etc/systemd/system/docker.service.d (2) printf "[Service]\nEnvironment=\"HTTPS_PROXY=$https_proxy\" \"NO_PROXY=$no_proxy\"\n" | sudo tee /etc/systemd/system/docker.service.d/proxy.conf (3) sudo systemctl daemon-reload (4) sudo systemctl restart docker
Build Docker image(s):
(1) mkdir build (2) cd build (3) cmake .. (4) cd Xeon/ubuntu-16.04/ffmpeg # please build your specific <_platform_>/<_OS_>/<_image_> only as a full build takes a long time. (5) make # build on the target processor for best performance. (6) ctest
Run shell:
Xeon/ubuntu-16.04/ffmpeg/shell.sh #<_platform_>/<_OS_>/<_image_>
Customize:
#include(transform360.m4) in Xeon/ubuntu-16.04/ffmpeg/Dockerfile.m4
to add essential 360 video transformation in the FFmpeg build.Use alternative repo:
export AOM_REPO=... export VPX_REPO=... make
For a list of all REPOs and their versions, run the following command:
grep -E '_(REPO|VER)=' template/*.m4
Use Dockerfile(s) in other projects:
DOCKER_REPO=${DOCKER_REPO="https://raw.githubusercontent.com/OpenVisualCloud/Dockerfiles/master/Xeon/ubuntu-18.04"} (echo "# xeon-ubuntu1804-ffmpeg" && curl ${DOCKER_REPO}/ffmpeg/Dockerfile) > Dockerfile.2 (echo "# xeon-ubuntu1804-nginx-rtmp" && curl ${DOCKER_REPO}/nginx+rtmp/Dockerfile) > Dockerfile.1
build.sh:
for dep in .2 .1; do image=$(grep -m1 '#' "Dockerfile$dep" | cut -d' ' -f2) sudo docker build --network=host --file="Dockerfile$dep" -t "$image:latest" . $(env | grep -E '_(proxy)=' | sed 's/^/--build-arg /') done
Next Steps
To view the available Open Visual Cloud reference pipeline Docker files, choose from the menu on the left.
Further information can be found at the Open Visual Cloud Dockerfiles GitHub Repo.