From bfe36d3aa8a6df7918cf530de35d1dfae1fe9500 Mon Sep 17 00:00:00 2001 From: CG Date: Sun, 3 Nov 2024 14:47:25 +0100 Subject: [PATCH] Preparing migration to buildah-build action --- .github/workflows/build-image.yml | 22 +++++++++++++++------- Dockerfile => Containerfile | 7 +++++-- README.md | 13 ++++++++----- 3 files changed, 28 insertions(+), 14 deletions(-) rename Dockerfile => Containerfile (84%) diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 1c2b33c..4082c3a 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -3,19 +3,27 @@ name: Container image build on: push: branches: + - develop - master paths: - - "Dockerfile" + - "Containerfile" pull_request: branches: - master paths: - - "Dockerfile" - + - "Containerfile" jobs: build: - runs-on: ubuntu-22.04 + name: Build image + runs-on: ubuntu-24.04 + steps: - - uses: actions/checkout@v2 - - name: Build the container image - run: docker build . -f ./Dockerfile -t mpv:$(date +%s) + - uses: actions/checkout@v4 + + - uses: redhat-actions/buildah-build@v2 + name: Buildah action + with: + image: ${{ github.repository }} + tags: ${{ github.sha }} + containerfiles: | + ./Containerfile diff --git a/Dockerfile b/Containerfile similarity index 84% rename from Dockerfile rename to Containerfile index de6f8a0..668626a 100644 --- a/Dockerfile +++ b/Containerfile @@ -6,6 +6,8 @@ LABEL org.label-schema.name="mpv" LABEL org.label-schema.schema-version="1.0" LABEL org.label-schema.vcs-url="https://github.com/cremuzzi/docker-mpv" +ARG YTDL_VERSION=2024.08.07 + RUN apk add --no-cache \ ffmpeg \ mesa-demos \ @@ -15,8 +17,9 @@ RUN apk add --no-cache \ python3 \ ttf-dejavu \ && ln -s python3 /usr/bin/python \ - && wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl \ - && chmod 755 /usr/local/bin/youtube-dl \ + && wget https://github.com/ytdl-org/ytdl-nightly/releases/download/${YTDL_VERSION}/youtube-dl \ + -O /usr/local/bin/youtube-dl \ + && chmod 0755 /usr/local/bin/youtube-dl \ && adduser -u 1000 -D mpv \ && mkdir -p /home/mpv/media \ && mkdir -p /home/mpv/.config/pulse \ diff --git a/README.md b/README.md index ae5be33..62a1189 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,13 @@ Once you are there, you can just explore the folder and play the media file that Please notice in the example above that we are mounting a few volumes that allow your container to connect as a client to your host's pulseaudio and Xorg server. -## youtube-dl +## yt-dl -The image comes with **youtube-dl** as well. So you can play YT content directly like this: +This image comes with **yt-dl** installed. +You can play yt-dl supported content via +running this image with command `mpv https://media/url/`. + +Eg.: ```sh docker run --rm -i -t \ @@ -36,11 +40,10 @@ docker run --rm -i -t \ -v /etc/machine-id:/etc/machine-id:ro \ -v /run/user/1000/pulse:/run/user/1000/pulse \ -v $HOME/.Xauthority:/home/mpv/.Xauthority \ - cremuzzi/mpv mpv http://youtube.com/watch?v=yt-video-id + cremuzzi/mpv mpv https://media/url/ ``` -The difference here is that we are not mounting any media folder from the host. -In this example we are running a container with the custom command "mpv yt-video-url", then mpv will take care of everything for you. +As long as your media url is retrievable by yt-dl then mpv should take care of reproducing it. ## Further reading