Docker Express Install

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.

Installing Docker

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:

Downloading demo contents

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 created:

http://repository.unified-streaming.com/tears-of-steel-x.y.z.zip

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.

Installing the license key

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.

When you obtained a license key, create one more sub-directory called key in the usp directory. To get the Origin to run, this sub-directory should contain your license key. Simply make a new plain text file named usp-license.key, copy in your key (and nothing more) and save. This should get you the following situation:

usp/tears-of-steel
usp/key/usp-license.key

Note

On your system file extensions may be hidden, so do ensure the file with the license key is named correctly and not usp-license.key.txt for example.

Using Docker Hub images

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 an Apache webserver install.

Running the demo with Docker

Now that all the prerequisites are in place, you can run your Docker command and create an Origin demo container. Please note that 'x.y.z' should be replaced with the current version, see the release notes which are kept here.

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 -it -p 80:80 -v /usp/tears-of-steel:/var/www/localhost/htdocs \
  -v /usp/key:/home unifiedstreaming/origin:x.y.z

Note

Please use the full path (e.g. /Users/<login>/usp or /home/<user>/usp etc.) to the usp directory you created.

Using the demo

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:

../_images/demo.png

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.

Creating your own images

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:

http://apk.unified-streaming.com/repo

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 /etc/apk/keys/alpine@unified-streaming.com.rsa.pub \
http://apk.unified-streaming.com/alpine@unified-streaming.com.rsa.pub

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.

Dockerfile

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 /etc/apk/keys/alpine@unified-streaming.com.rsa.pub http://apk.unified-streaming.com/alpine@unified-streaming.com.rsa.pub
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

Apache configuration

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 avaluation. If you require different settings or features please make sure to create your own image accordingly.