Skip to content

Commit 615eb6c

Browse files
authored
Merge pull request #2 from cremuzzi/develop
Upgrade base image to alpine:3.20
2 parents 3af94d2 + 37e222a commit 615eb6c

File tree

5 files changed

+82
-75
lines changed

5 files changed

+82
-75
lines changed

.github/workflows/build-image.yml

+18-7
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
1-
name: Container image build
1+
name: Buildah Build
22

33
on:
44
push:
55
branches:
6+
- develop
67
- master
78
paths:
8-
- "Dockerfile"
9+
- "Containerfile"
910
pull_request:
1011
branches:
1112
- master
1213
paths:
13-
- "Dockerfile"
14+
- "Containerfile"
1415

1516
jobs:
1617
build:
17-
runs-on: ubuntu-22.04
18+
name: Build image
19+
runs-on: ubuntu-24.04
20+
1821
steps:
19-
- uses: actions/checkout@v2
20-
- name: Build the container image
21-
run: docker build . -f ./Dockerfile -t mpv:$(date +%s)
22+
- uses: actions/checkout@v4
23+
24+
# https://github.com/redhat-actions/buildah-build
25+
- name: Buildah build
26+
id: build-image
27+
uses: redhat-actions/buildah-build@v2
28+
with:
29+
image: mpv
30+
tags: latest ${{ github.ref_name }}
31+
containerfiles: |
32+
./Containerfile

.github/workflows/push-image.yml

+27-25
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,36 @@
1-
name: Publish container image to Docker Hub
1+
name: Buildah Build and Push
22

33
on:
44
push:
55
tags:
66
- '*'
77

88
jobs:
9-
push_to_registry:
10-
name: Push Container image to Docker Hub
11-
runs-on: ubuntu-22.04
9+
build_n_push:
10+
name: Build and push
11+
runs-on: ubuntu-24.04
12+
1213
steps:
13-
- name: Check out the repo
14-
uses: actions/checkout@v2
15-
16-
- name: Log in to Docker Hub
17-
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
18-
with:
19-
username: ${{ secrets.DOCKER_USERNAME }}
20-
password: ${{ secrets.DOCKER_PASSWORD }}
21-
22-
- name: Extract metadata (tags, labels) for Docker
23-
id: meta
24-
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
25-
with:
26-
images: cremuzzi/mpv
14+
- uses: actions/checkout@v4
2715

28-
- name: Build and push Docker image
29-
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
30-
with:
31-
context: .
32-
labels: ${{ steps.meta.outputs.labels }}
33-
push: true
34-
tags: ${{ steps.meta.outputs.tags }}
16+
# https://github.com/redhat-actions/buildah-build
17+
- name: Buildah build
18+
id: build-image
19+
uses: redhat-actions/buildah-build@v2
20+
with:
21+
image: mpv
22+
tags: latest ${{ github.ref_name }}
23+
containerfiles: |
24+
./Containerfile
25+
26+
# https://github.com/redhat-actions/push-to-registry
27+
- name: Push To docker.io
28+
id: push-to-docker-io
29+
uses: redhat-actions/push-to-registry@v2
30+
with:
31+
image: ${{ steps.build-image.outputs.image }}
32+
tags: ${{ steps.build-image.outputs.tags }}
33+
registry: docker.io/cremuzzi
34+
username: ${{ secrets.DOCKER_USERNAME }}
35+
password: ${{ secrets.DOCKER_PASSWORD }}
36+

Containerfile

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM alpine:3.20
2+
3+
LABEL maintainer="Carlos Remuzzi <[email protected]>"
4+
LABEL org.label-schema.description="Containerization of mpv.io"
5+
LABEL org.label-schema.name="mpv"
6+
LABEL org.label-schema.schema-version="1.0"
7+
LABEL org.label-schema.vcs-url="https://github.com/cremuzzi/docker-mpv"
8+
9+
ARG YTDL_VERSION=2024.08.07
10+
11+
RUN apk add --no-cache \
12+
ffmpeg \
13+
mesa-dri-gallium \
14+
mpv \
15+
pulseaudio \
16+
python3 \
17+
ttf-dejavu \
18+
&& wget https://github.com/ytdl-org/ytdl-nightly/releases/download/${YTDL_VERSION}/youtube-dl \
19+
-O /usr/local/bin/youtube-dl \
20+
&& chmod 0755 /usr/local/bin/youtube-dl \
21+
&& echo "UP add volume +2" > /etc/mpv/input.conf \
22+
&& echo "DOWN add volume -2" >> /etc/mpv/input.conf \
23+
&& adduser -u 1000 -D mpv
24+
25+
USER mpv
26+
27+
WORKDIR /home/mpv/
28+
29+
CMD ["/bin/ash"]

Dockerfile

-38
This file was deleted.

README.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ Once you are there, you can just explore the folder and play the media file that
2424
Please notice in the example above that we are mounting a few volumes that allow your container to
2525
connect as a client to your host's pulseaudio and Xorg server.
2626

27-
## youtube-dl
27+
## yt-dl
2828

29-
The image comes with **youtube-dl** as well. So you can play YT content directly like this:
29+
This image comes with **yt-dl** installed.
30+
You can play yt-dl supported content via
31+
running this image with command `mpv https://media/url/`.
32+
33+
Eg.:
3034

3135
```sh
3236
docker run --rm -i -t \
@@ -36,11 +40,10 @@ docker run --rm -i -t \
3640
-v /etc/machine-id:/etc/machine-id:ro \
3741
-v /run/user/1000/pulse:/run/user/1000/pulse \
3842
-v $HOME/.Xauthority:/home/mpv/.Xauthority \
39-
cremuzzi/mpv mpv http://youtube.com/watch?v=yt-video-id
43+
cremuzzi/mpv mpv https://media/url/
4044
```
4145

42-
The difference here is that we are not mounting any media folder from the host.
43-
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.
46+
As long as your media url is retrievable by yt-dl then mpv should take care of reproducing it.
4447

4548
## Further reading
4649

0 commit comments

Comments
 (0)