Managing Docker containers on Videon devices is known to work with Docker images pulled from both Docker Hub and Amazon ECR. Docker registries other than those listed are untested, but should work as long as they use standard Docker functions for login and pulling images.
Prerequisites
Prerequisites for this guide are:
- LiveEdge Cloud API URL
- Personal Access Token
- GUID for each device on which the Docker container is to be installed
Example: How to install, run, and configure the Videon HTML5 Docker container
-
Complete prerequisites above.
- Pull latest image to Videon device using Pull Docker Image.
- Payload:
{
"repository": "videonlabs/html5-graphics-renderer",
"tag":"latest",
"username": "",
"password": ""
}
- Payload:
- Remove old container (if one exists).
- Find ID of container named ‘HTML5’ using Get Docker Container List.
- Kill old container ID using Docker Container Action.
-
{
"action": "kill"
}
-
- Delete old container ID using Delete Docker Container.
-
Find ID of image tagged 'videonlabs/html5-graphics-renderer:latest' using Get Docker Images
- Example response:
{
"images": [
{
"id": "a2ef1358fb071b8c0d4dc44533ce3c0bde9bc72180b5fed86e31e9a8cad67e09", <--- Image ID
"size": 1655148092,
"created": "2023-10-09T17:03:58.212803818Z",
"tags": [
"videonlabs/html5-graphics-renderer:latest"
]
}
],
"operation_name": "GetDockerImages",
"api_request_id": "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx"
}
- Example response:
-
Create new container named 'HTML5' using Create Docker Container
- Payload:
{
"name": "HTML5",
"image_id": "{{ID_OF_IMAGE_PULLED}}",
"restart_policy": {
"name": "always",
"MaximumRetryCount": 0
},
"environment": [],
"ports": [
{
"host_port": 1323,
"container_port": 1323
}
],
"volumes": [
{
"host_path": "/data/local/vl-html-file-overlay-app",
"container_path": "/app/persist",
"mode": "rw"
}
]
}
- Payload:
-
Find ID of new container named 'HTML5' using Get Docker Container List.
- Example response:
{
"containers": [
{
"name": "HTML5",
"image": "a2ef1358fb071b8c0d4dc44533ce3c0bde9bc72180b5fed86e31e9a8cad67e09", <--- Image ID
"id": "f10282a00e97326840b92fcd51125d4e5fe4865a37ac61f2bd20561c98a748a4", <--- Container ID
"status": "created"
}
],
"operation_name": "GetDockerContainers",
"api_request_id": "xxxxxxxx-xxxx-xxxxx-xxxxx-xxxxxxxx"
}
- Example response:
- Start new container ID using Docker Container Action.
- Payload:
{
"action": "start"
}
- Payload:
- Configure HTML5 URL (perform this step anytime URL needs to be set/changed)
- Remove old URL using Send Device Command.
- Payload:
{
"command": "rest_direct_delete",
"rest_endpoint": ":1323/v1/stop"
}
- Payload:
- Set new URL using Send Device Command.
- Payload (fps can only be a value from 1-4 currently):
{
"command": "rest_direct_post",
"rest_endpoint": ":1323/v1/start?url={{utf_8_encoded_url}}&fps={{fps_value}}"
}
- Payload (fps can only be a value from 1-4 currently):
- Check URL is set and container is running
- Send status gathering command using Send Device Command.
- Payload:
{
"command": "rest_direct_get",
"rest_endpoint": ":1323/process_status"
}
- Payload:
- Check previous command results using Get All Device Command Results and read through results (latest at top of response)
- Example response:
{
"commands": [
{
"command_guid": "xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"creation_timestamp": "2023-10-24T15:47:33.299817Z",
"command": "rest_direct_get",
"finished": true,
"finished_timestamp": "2023-10-24T15:47:33.765000Z",
"request": {
"rest_endpoint": ":1323/process_status"
},
"response": {
"device_received_timestamp": "2023-10-24T15:47:33.532005Z",
"device_complete_timestamp": "2023-10-24T15:47:33.588716Z",
"result": {
"state": "COMPLETE",
"message": "Rest call completed successfully",
"data": {
"fps": {{CONFIGURED_FPS}},
"running": true,
"startTime": "2023-10-24T01:42:07Z",
"url": "{{EXPECTED_URL}}"
}
}
}
}
}
- Example response:
- Send status gathering command using Send Device Command.
- Remove old URL using Send Device Command.
Related API documentation
Below are the relevant parts of the LiveEdge Cloud REST API documentation that will be needed to manage Docker containers on devices.