-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mediamtx: Publish deployed version if runtime args are present (#3285)
* mediamtx: Publish deployed version if runtime args are present * dockerfile.mediamtx: Make use of layer caching when building docker image * mediamtx-entry.bash: Use exec to hand off the script
- Loading branch information
1 parent
de9b447
commit 1d55e9b
Showing
5 changed files
with
52 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,15 @@ name: MediaMTX Docker build | |
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
paths: | ||
- 'docker/*mediamtx*' | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- 'docker/Dockerfile.mediamtx' | ||
- 'docker/mediamtx.yml' | ||
- 'docker/*mediamtx*' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
|
@@ -20,7 +23,7 @@ jobs: | |
permissions: | ||
packages: write | ||
contents: read | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
FROM ubuntu:24.04 | ||
|
||
ENV MEDIAMTX_VERSION="v1.9.3" | ||
FROM ubuntu:24.04 | ||
|
||
# we need curl in the image as it's later used in the runOnReady command | ||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
ca-certificates \ | ||
curl \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
ca-certificates \ | ||
curl \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ENV MEDIAMTX_VERSION="1.9.3" | ||
|
||
ADD "https://github.com/bluenviron/mediamtx/releases/download/v${MEDIAMTX_VERSION}/mediamtx_v${MEDIAMTX_VERSION}_linux_amd64.tar.gz" /opt/mediamtx.tar.gz | ||
|
||
RUN tar xzf /opt/mediamtx.tar.gz -C /opt/ \ | ||
&& mkdir -p /usr/local/bin /etc/mediamtx/ \ | ||
&& mv /opt/mediamtx /usr/local/bin/mediamtx \ | ||
&& mv /opt/mediamtx.yml /etc/mediamtx/mediamtx.yml \ | ||
&& rm -rf /opt/ | ||
|
||
RUN curl -L https://github.com/bluenviron/mediamtx/releases/download/${MEDIAMTX_VERSION}/mediamtx_${MEDIAMTX_VERSION}_linux_amd64.tar.gz -o /mediamtx.tar.gz \ | ||
&& tar xzvf /mediamtx.tar.gz \ | ||
&& rm /mediamtx.tar.gz | ||
COPY mediamtx-entry.bash / | ||
|
||
ENTRYPOINT ["/mediamtx"] | ||
ENTRYPOINT ["/mediamtx-entry.bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
[ -v DEBUG ] && set -x | ||
|
||
set -euo pipefail | ||
|
||
if [ -v LP_PUBLISH_MEDIAMTX_METRICS ]; then | ||
if [ -z "$LP_PUBLISH_MEDIAMTX_METRICS_ENDPOINT" ]; then | ||
echo >&2 "No endpoint specified for publishing mediamtx metrics." | ||
fi | ||
echo <<EOF | | ||
# HELP version Current software version as a tag, always 1 | ||
# TYPE version gauge | ||
version{app="MediaMTX",version="$MEDIAMTX_VERSION"} 1 | ||
EOF | ||
curl -X POST --data-binary @- "$LP_PUBLISH_MEDIAMTX_METRICS_ENDPOINT" | ||
fi | ||
|
||
exec "${@:-/usr/local/bin/mediamtx}" |