Docker Express Install¶
Table of Contents
Docker is a container platform. There is a desktop version of Docker available for Windows and macOS. This tutorial will assume the use of one of those versions.
First, download Docker's installer for your platform.
Assuming you are using a desktop machine, once installed and started you will see the Docker logo in your taskbar or system tray indicating Docker is running.
After having installed Docker, there are two routes to getting a container with Unified Origin to run. The quickest method uses a prebuilt image from Docker Hub. This tutorial will make use of this method.
A more elaborate but more flexible method makes use of images you can build yourself, with the Alpine Linux packages of Origin and Packager. How these images can be built is explained at the end of this tutorial.
Whichever route you may take, you will need the following to get our evaluation environment to run:
- Demo content that we provide for download and which is free to use.
- An evaluation license key that you can easily obtain after registration.
This tutorial will start of by first getting these two prerequisites in order:
The first thing we will do is create a directory to host the demo content, this can be anywhere on your system as we will create a volume mount in the Docker container to map our local content directory to the container.
This also applies to the file with the evaluation key that we will create in the next step and that the Origin requires as a license.
For the demo content, create a directory called
usp, download below file
('x.y.z' should be replaced with the current version, see the release notes
which are kept here) and extract it to the
usp directory you just
Rename the extracted directory to
tears-of-steel for ease of use.
You should now have a directory called
usp that contains a sub-directory called
tears-of-steel, which contains the demo files.
After registration on our website, you can get an evaluation key by clicking the following button:
The website will ask you to login before you can get a key. If you do not have a login, please go to registration first.
If you have made sure that you have a license key, you can move on to the next step.
Docker Hub is a centralized platform that hosts a wide range of image repositories that can be run with a simple Docker command (which we will do in the next step).
There are prebuilt images available on Docker Hub of both Packager and Origin, and for the purpose of this tutorial we will be using the Origin image, which already contains the Apache webserver installation that is required to run Unified Origin.
Now that all the prerequisites are in place, you can run your Docker command and create an Origin demo container.
You should use a localhost port that is available. In the following example the first port 80 is your port and the second port 80 is the Apache port in the container.
docker run -e USP_LICENSE_KEY=<your-license-key> \ -v /<full-path>/usp/tears-of-steel:/var/www/unified-origin \ -p 80:80 unifiedstreaming/origin
Please use the full path (e.g. /Users/<login>/usp or /home/<user>/usp etc.)
tears-of-steel directory you created.
When the container launches and starts running, you will see the demo page with links to all the features on the port you have specified, e.g. 127.0.0.1:80. It should look like our online Unified Streaming Demo, which looks like this:
All the streams are played out by the Origin running in the Docker container.
Also note that if you have a question or need help, you can ask in our forum.
To create your own images for use with Docker, you need our Alpine Linux packages of Origin and Packager . Using a Dockerfile, you can instruct Docker to fetch these packages from our repository.
The package repository for Origin and Packager is at the following url:
To install both packages, your Dockerfile should contain the following commands:
RUN apk --update add bash bash-completion apache2 --repository \ http://nl.alpinelinux.org/alpine/edge/testing RUN wget -q -O /email@example.com \ http://firstname.lastname@example.org RUN apk --update add mp4split mod_smooth_streaming --repository \ http://apk.unified-streaming.com/repo
The first command fetches and installs the public key to validate the repository contents.
The second command installs the Packager and the Origin. Both are required for the Origin to function.
To build the image you can do the following:
#!/bin/bash cd DIRECTORY_CONTAINING_ABOVE_DOCKERFILE docker build -t YOUR_REPOSITORY_NAME/origin .
This will install the latest public release of the software, of which you can check the release notes kept here.
The Dockerfile used to build the origin image used in above examples is the following:
FROM alpine:3.4 # Install packages RUN apk --update add bash bash-doc bash-completion apache2 --repository http://nl.alpinelinux.org/alpine/edge/testing/ RUN wget -q -O /email@example.com http://firstname.lastname@example.org RUN apk --update add mp4split mod_smooth_streaming --repository http://apk.unified-streaming.com//repo # Configure origin COPY config/usp-origin.conf /etc/apache2/conf.d/usp-origin.conf # Fix apache2 RUN mkdir -p /run/apache2 # Pipe errors to STDOUT RUN sed -ri -e 's!^(\s*CustomLog)\s+\S+!\1 /proc/self/fd/1!g' -e 's!^(\s*ErrorLog)\s+\S+!\1 /proc/self/fd/2!g' "/etc/apache2/httpd.conf" EXPOSE 80 443
The Apache configuration is the following:
LoadModule smooth_streaming_module modules/mod_smooth_streaming.so AddHandler smooth-streaming.extensions .ism <Location /> UspHandleIsm on </Location> UspLicenseKey /home/usp-license.key
Please note that this is a stock install of Apache with the defaults of the Alpine distribution as well as a default USP install, suitable for an evaluation. If you require different settings or features please make sure to create your own image accordingly.