From 80940b61be222b6e39b26e102091feb1f390ad1c Mon Sep 17 00:00:00 2001 From: ingalls Date: Fri, 23 Aug 2024 14:44:17 -0600 Subject: [PATCH 1/2] Volume --- Dockerfile | 16 +++++++++++++++- start | 14 ++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100755 start diff --git a/Dockerfile b/Dockerfile index 2328d8d..2b74a46 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,17 @@ -FROM bluenviron/mediamtx:1.8.5-ffmpeg +FROM ubuntu:24.04 + +ENV MEDIA_VERSION=1.8.5 + +RUN apt-get upgrade \ + && apt-get update \ + && apt-get install -y curl + +RUN curl -L "https://github.com/bluenviron/mediamtx/releases/download/v${MEDIA_VERSION}/mediamtx_v${MEDIA_VERSION}_linux_amd64.tar.gz" > /archive.tar.gz \ + && tar -xzvf /archive.tar.gz \ + && rm /archive.tar.gz COPY mediamtx.yml / + +COPY start / + +ENTRYPOINT [ "/start" ] diff --git a/start b/start new file mode 100755 index 0000000..730ca78 --- /dev/null +++ b/start @@ -0,0 +1,14 @@ +#!/bin/bash +# +# Add MediaConfig File +# + +set -x +set -euo pipefail + +# Copy EFS Persisted certs to Let's Encrypt Dir +if [ -e "/opt/mediamtx/mediamtx.yml" ]; then + cp "/mediamtx.yml" "/opt/mediamtx/mediamtx.yml" +fi; + +/mediamtx /opt/mediamtx/mediamtx.yml From 5a3198b7f68617f7a16f2929acf13dab744f06c3 Mon Sep 17 00:00:00 2001 From: ingalls Date: Fri, 23 Aug 2024 14:52:02 -0600 Subject: [PATCH 2/2] Copy if not exists --- start | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start b/start index 730ca78..d57c61e 100755 --- a/start +++ b/start @@ -7,7 +7,7 @@ set -x set -euo pipefail # Copy EFS Persisted certs to Let's Encrypt Dir -if [ -e "/opt/mediamtx/mediamtx.yml" ]; then +if [ ! -e "/opt/mediamtx/mediamtx.yml" ]; then cp "/mediamtx.yml" "/opt/mediamtx/mediamtx.yml" fi;