Skip to content

Commit

Permalink
doc: Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
jim60105 committed Jan 8, 2024
1 parent 3e1e9d9 commit ede833f
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,50 @@ The `[options]`, `[url]` placeholder should be replaced with the options and arg

You can find all available tags at [ghcr.io](https://github.com/jim60105/docker-streamlink/pkgs/container/streamlink/versions?filters%5Bversion_type%5D=tagged) or [quay.io](https://quay.io/repository/jim60105/streamlink?tab=tags).

## Building the Docker Image

### Dockerfiles

This repository contains four Dockerfiles for building Docker images based on different base images:

| Dockerfile | Base Image |
| ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| [Dockerfile](Dockerfile) | [Alpine official image](https://hub.docker.com/_/alpine/) |
| [alpine.Dockerfile](alpine.Dockerfile) | [Python official image 3.12-alpine](https://hub.docker.com/_/python/) |
| [ubi.Dockerfile](ubi.Dockerfile) | [Red Hat Universal Base Image 9 Minimal](https://catalog.redhat.com/software/containers/ubi9/ubi-minimal/615bd9b4075b022acc111bf5) |
| [distroless.Dockerfile](distroless.Dockerfile) | [distroless-python](https://github.com/alexdmoss/distroless-python) |

### Build Arguments

The [alpine.Dockerfile](alpine.Dockerfile), [ubi.Dockerfile](ubi.Dockerfile), ans [distroless.Dockerfile](distroless.Dockerfile) are built using a build argument called `BUILD_VERSION`. This argument represents [the release version of streamlink](https://github.com/streamlink/streamlink/tags), such as `6.5.0` or `6.4.2`.

It is important to note that the [Dockerfile](Dockerfile) always builds with [the latest apk package source](https://pkgs.alpinelinux.org/package/edge/community/aarch64/streamlink), so it can't set the build version explicitly.

> [!NOTE]
>
> - The apk edge branch follows the latest release of streamlink.
> - The `alpine.Dockerfile` installs streamlink from pip source, so the image size may slightly different compared to the `Dockerfile` even when they have the same version.
### Build Command

> [!NOTE]
> If you are using an earlier version of the docker client, it is necessary to [enable the BuildKit mode](https://docs.docker.com/build/buildkit/#getting-started) when building the image. This is because I used the `COPY --link` feature which enhances the build performance and was introduced in Buildx v0.8.
> With the Docker Engine 23.0 and Docker Desktop 4.19, Buildx has become the default build client. So you won't have to worry about this when using the latest version.
```bash
docker build -t streamlink .
docker build --build-arg BUILD_VERSION=6.5.0 -f ./alpine.Dockerfile -t streamlink:alpine .
docker build --build-arg BUILD_VERSION=6.5.0 -f ./ubi.Dockerfile -t streamlink:ubi .
docker build --build-arg BUILD_VERSION=6.5.0 -f ./distroless.Dockerfile -t streamlink:distroless .
```

> [!TIP]
> I've notice that that both the UBI version and the Distroless version offer no advantages over the Alpine version. So _**please use the Alpine version**_ unless you have specific reasons not to. All of these base images are great, some of them were simply not that suitable for our project.
## LICENSE

> [!NOTE]
> The main program, [streamlink/streamlink](https://github.com/streamlink/streamlink), is distributed under [BSD-2-Clause license](https://github.com/streamlink/streamlink/blob/main/LICENSE).
> The main program, [streamlink/streamlink](https://github.com/streamlink/streamlink), is distributed under [BSD-2-Clause license](https://github.com/streamlink/streamlink/blob/master/LICENSE).
> Please consult their repository for access to the source code and licenses.
> The following is the license for the Dockerfiles and CI workflows in this repository.
Expand Down

0 comments on commit ede833f

Please sign in to comment.