This repository builds a custom Docker image based on the official MediaMTX image, adding AWS CLI capabilities, and pushes it to GitHub Container Registry (GHCR).
- The Dockerfile uses the official MediaMTX FFmpeg image as a base and adds the AWS CLI package.
- A GitHub Actions workflow checks for new releases of the official MediaMTX image (on push to main, on a schedule, or manually).
- If a new version is found, it automatically builds and pushes the FFmpeg variant to GHCR.
We only build the FFmpeg variant because the standard MediaMTX image is built from scratch and contains no shell or package manager, making it impossible to add additional packages like AWS CLI. The FFmpeg variant is based on Alpine Linux and includes the necessary tools for customization.
For each MediaMTX release, one image is built:
ghcr.io/<owner>/mediamtx:<version>-ffmpeg- FFmpeg variant with AWS CLI
The workflow runs on:
- Pushes to the
mainbranch - A daily schedule (6am UTC)
- Manual dispatch via the GitHub Actions UI
- Fetch latest upstream tag:
- Uses a shell step with
curlandjqto fetch the latest stable tag from Docker Hub forbluenviron/mediamtx.
- Uses a shell step with
- Compare with last built tag:
- If the tag is new, proceeds to build and push the FFmpeg variant.
- Log in to GHCR:
- Uses
docker/login-actionto authenticate to GitHub Container Registry with the built-inGITHUB_TOKEN.
- Uses
- Build and push:
- Uses
docker/build-push-actionto build the FFmpeg image variant with AWS CLI and push to GHCR.
- Uses
- Update last built tag:
- Stores the last built tag in
.last_built_tagand commits it to the repository.
- Stores the last built tag in
The built images include AWS CLI functionality on top of MediaMTX capabilities. Use them as you would the standard MediaMTX images:
docker run --rm -p 8554:8554 ghcr.io/<your-org-or-username>/mediamtx:<tag>-ffmpegTo build and run locally:
# Build FFmpeg variant with AWS CLI
docker build --build-arg VERSION_TAG=<tag>-ffmpeg -t my-mediamtx:local .
# Run
docker run --rm -p 8554:8554 my-mediamtx:local- The workflow is defined in
.github/workflows/rebuild-on-upstream.yml. - It uses:
- A shell step to fetch the latest upstream tag with
curlandjq. - docker/login-action for GHCR authentication.
- docker/build-push-action to build and push the FFmpeg variant image.
- stefanzweifel/git-auto-commit-action to update the last built tag.
- A shell step to fetch the latest upstream tag with
- Edit the Dockerfile to add additional packages or configuration.
- The workflow automatically builds the FFmpeg variant when new MediaMTX releases are detected.