-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (43 loc) · 1.33 KB
/
Dockerfile
File metadata and controls
50 lines (43 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Use latest stable Python 3 slim image
FROM python:3.13-slim
# Metadata
LABEL maintainer="Timo Taskinen <timo.taskinen@iki.fi>" \
org.opencontainers.image.description="Downloader for Yleisradio TV and radio programs" \
org.opencontainers.image.source="https://github.com/taskinen/yle-dl-docker"
# Build arguments
ARG YLE_DL_VERSION
ARG BUILDPLATFORM
ARG TARGETPLATFORM
# Environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIPX_HOME=/opt/pipx \
PIPX_BIN_DIR=/usr/local/bin \
PATH="/usr/local/bin:$PATH"
# Install system dependencies and pipx in a single optimized layer
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
ffmpeg \
libffi-dev \
libxml2-dev \
libxslt-dev \
pipx \
python3-dev \
wget \
ca-certificates && \
apt-get clean
# Install yle-dl using pipx with build cache
RUN --mount=type=cache,target=/root/.cache/pipx \
pipx ensurepath && \
if [ -n "$YLE_DL_VERSION" ]; then \
pipx install yle-dl==$YLE_DL_VERSION; \
else \
pipx install yle-dl; \
fi
# Set working directory
WORKDIR /out
# Set entrypoint
ENTRYPOINT ["yle-dl"]