While using ADB and other local environment processes for while developing a Docker container, when deploying a container into a production environment, many workflows require being able to deploy the container via LiveEdge Cloud. Below is an example of how to deploy a custom container once the development stage is complete (or you want to run a development-stage container on a remote Videon device). The container used in this example is Videon's SCTE35 Ad Insertion Button sample container: https://github.com/VideonLabs/liveedge-compute-code-examples/tree/main/ad-insertion-button
The distilled steps are as follows:
- Build the container image to work on Videon devices (linux/arm64)
- Upload the container image to either Docker Hub or Amazon ECR
- Use the Videon LiveEdge Cloud UI or API to pull the container image to the target Videon device(s)
- Use the Videon LiveEdge Cloud UI or API to run a container instance based on the above image on the target Videon device(s)
Building a container image to use on Videon devices
Method 1: Using Buildx on a host machine (Recommended)
Some developers may find it easier to build a container outside of the Videon device so that they do not have to go through the process of logging in to the Videon device via ADB and working with the device's internal system. Building the container outside of the Videon device offers multiple advantages:
- No need to hassle with connecting to a Videon device via ADB
- Faster ability to update a container with code changes and test rapidly on the host machine before building for the Videon device (only in cases where the container does not need to access local Videon device system interfaces)
- Likely faster build times
- Videon device's limited storage (compared to modern computers) does not become cluttered with "ghost" images
Here is an example of building a container on a computer (again, using Videon's SCTE insertion sample):
- Navigate into directory containing the Dockerfile
- Run the following docker buildx command
docker buildx build --load --platform linux/arm64 --no-cache --progress=plain -t videonlabs/ad-insertion-button:2.1-exampleOnce that command completes, the image will be present on the host machine, ready to be uploaded to an online registry for installation on a Videon device
Method 2: Using a Videon device
This is an older and less efficient method, but it does ensure that the container builds for the Videon system, accounting for any possible unknown limitations, though there are no known limitations to date: Using Docker with LiveEdge® Compute
Uploading a container image to the internet
Method 1: Docker Hub (Recommended)
All of Videon's public Docker container images are hosted in Docker Hub, so this is the method we recommend. Once a Docker Hub account is set up, pushing the image to Docker hub is as easy as 2 commands:
docker login
[Enter login information]
docker push videonlabs/ad-insertion-button:2.1-exampleOnce the push command completes, the container image will be publicly listed in Docker Hub. the 2.1-example tag for the pushed sample container can be seen here: https://hub.docker.com/r/videonlabs/ad-insertion-button/tags
If the container needs to be listed privately, see Docker's documentation on managing repositories: https://docs.docker.com/docker-hub/repos/
Method 2: Amazon ECR
Videon hosts some private Docker container images in Amazon ECR. These containers are mostly the proprietary ones used on Max as part of our "containerized" device architecture, meaning our Max devices are powered by Docker!
In the spirit of not re-inventing instructions (and accidentally missing important details) for this example, refer to Amazon's thorough instructions on pushing a container image to an ECR instance: https://docs.aws.amazon.com/AmazonECR/latest/userguide/docker-push-ecr-image.html
Pulling and running a container image on a Videon device
Method 1: Single "install" command (Recommended)
Via LiveEdge Cloud UI
Videon now offers a Container Directory for any containers that pass our validation process: Videon's LiveEdge Container Directory. If your container is still being developed, see method 2.
Via LiveEdge Cloud API
This method is recommended for script/automation workflows as it is a single API call that can be sent and left to complete.
See this Help Center Article: https://support.videonlabs.com/hc/en-us/articles/31837920407571-Single-Command-Installation-Uninstallation-of-Docker-Containers
- Example of the options available:
POST to https://api.videoncloud.com/v1/devices/<device_guid>/commands { "command": "docker_install", "data": { "image_url": "registry_account/your_image_url", "manifest": { "restart_policy": {"name": "always", "MaximumRetryCount": 0}, "environment": [{"key":"ENV1", "value":"value1"}, {"key": "ENV2", "value": "value2"}], "volumes": [{"host_path":"/path/to/expose", "container_path": "/container/path/to/link", "mode": "rw"}], "devices": [{"host_path":"/device/to/expose", "container_path": "/container/path/to/link", "mode": "rw"}], "ports": [{"host_port": 1234, "container_port": 1234}], "privileged": false <--(Privileged is only available to Videon Admins for device security purposes) "network_mode": "bridge" } } }
- This is the call made to install the SCTE35 sample container:
POST to https://api.videoncloud.com/v1/devices/<device_guid>/commands { "command": "docker_install", "data": { "image_url": "videonlabs/ad-insertion-button:2.1-example", "manifest": { "restart_policy": {"name": "always", "MaximumRetryCount": 0}, "privileged": true "network_mode": "bridge" } } }- Once the above call completes, the container has been pulled using the image URL and run using the manifest items as the run options
Method 2: Pull image then create/run container
Via LiveEdge Cloud UI
This method is recommended for non-technical users as it is far more user-friendly.
See this Help Center article: How to install a Docker container via the Containers tab
Via LiveEdge Cloud API
This method is intended for script/automation workflows. See the single command option above for a simpler approach.
See steps 1-8 in this Help Center article: Docker Container Management