Skip to content

Enable LL-HLS plugin support in Dockerfile #354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/docker-ll-hls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Test LL-HLS Plugin Installation

on: [push]

env:
DEBUG: true

jobs:
test-llhls:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Download LL-HLS plugin zip
run: |
curl -L -o low-latency-hls-plugin.zip ${{ secrets.LLHLS_PLUGIN_URL }}

- name: Build Docker Image with LL-HLS Plugin
run: |
docker build -f docker/Dockerfile_Process \
--build-arg LicenseKey="${{ secrets.ENTERPRISE_LICENSE }}" \
--build-arg InstallLLHLSPlugin=true \
-t antmedia-llhls:test .

- name: Run Container and Validate LL-HLS Installation
run: |
docker run -d -p 5080:5080 --name antmedia-llhls antmedia-llhls:test
sleep 30

echo "Checking if LL-HLS plugin is installed..."
docker run -d -p 5080:5080 --name antmedia-llhls antmedia-llhls:test
sleep 30

echo "Searching for low-latency-hls.jar under /usr/local/antmedia/webapps/"
FOUND=$(docker exec antmedia-llhls find /usr/local/antmedia/webapps/ -type f -name "low-latency-hls.jar" || true)

if [ -n "$FOUND" ]; then
echo "$FOUND"
else
exit 1
fi
echo "LL-HLS Plugin installed successfully."
36 changes: 36 additions & 0 deletions docker/Dockerfile_Process
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
# * Supervisor Configuration (Optional): If you want to use Supervisor to manage the Ant Media Server process, you can enable as follows. With this configuration, you can easily restart, stop the service, or run the `enable_ssl.sh` script for Ant Media Server.
# --build-arg UseSupervisor='true'
#
# * InstallLLHLSPlugin: Set this variable to 'true' to enable LL-HLS plugin to Ant Media Server.
# --build-arg InstallLLHLSPlugin='true'
#
# * LLHLSPluginZip: If the LL-HLS plugin is in the same folder as the Dockerfile, no path is needed. Otherwise, you must provide the path manually.
# --build-arg LLHLSPluginZip='low-latency-hls-plugin.zip'
#


FROM ubuntu:22.04

Expand All @@ -31,6 +38,8 @@ ARG InstallMediaPush
ARG MediaPushVersion
ARG UseSupervisor=false
ARG BranchName=master
ARG InstallLLHLSPlugin=false
ARG LLHLSPluginZip=low-latency-hls-plugin.zip

ENV UseSupervisor=${UseSupervisor}

Expand Down Expand Up @@ -122,4 +131,31 @@ RUN if [ "true" = "$UseSupervisor" ]; then \

##############################################################################


ADD ./${LLHLSPluginZip} /home/

RUN touch /.dockerenv

RUN if [ "$InstallLLHLSPlugin" = "true" ] && [ ! -f "/home/${LLHLSPluginZip}" ]; then \
echo "ERROR: LL-HLS Plugin ZIP file not found at /home/${LLHLSPluginZip}. Aborting."; \
echo "Please ensure '${LLHLSPluginZip}' is in the same directory as the Dockerfile."; \
exit 1; \
fi

RUN if [ "$InstallLLHLSPlugin" = "true" ]; then \
echo "Installing LL-HLS Plugin..."; \
cd /home && \
unzip ${LLHLSPluginZip} && \
cd low-latency-hls-plugin && \
bash -x install_low-latency-hls-plugin.sh && \
cd /home && \
rm -rf ${LLHLSPluginZip} low-latency-hls-plugin && \
echo "LL-HLS Plugin installation completed successfully."; \
else \
echo "LL-HLS Plugin installation skipped (InstallLLHLSPlugin=${InstallLLHLSPlugin})"; \
fi


RUN rm -f /.dockerenv

ENTRYPOINT [ "sh", "-c", "if [ \"$UseSupervisor\" = \"true\" ]; then exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf; else exec /usr/local/antmedia/start.sh \"$@\"; fi", "--" ]
Loading