dash-mpd-cli 0.2.9

Download media content from a DASH-MPEG or DASH-WebM MPD manifest.
# Build the container with
#
#    podman build -f Dockerfile
#    podman images
#    podman run -ti --rm dashmpd:alpine
#    

FROM docker.io/rust:latest AS builder

RUN rustup target add x86_64-unknown-linux-musl
RUN apt update && apt install -y musl-tools musl-dev
RUN update-ca-certificates

ENV USER=dashmpd
ENV UID=10001

RUN adduser \
    --disabled-password \
    --gecos "" \
    --home "/nonexistent" \
    --shell "/sbin/nologin" \
    --no-create-home \
    --uid "${UID}" \
    "${USER}"

WORKDIR /dashmpd
COPY ./ ./
RUN cargo update
RUN cargo build --target x86_64-unknown-linux-musl --release


# Now build the final image
FROM alpine
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /etc/group /etc/group

# install ffmpeg, mp4box, mkvmerge etc. GPAC is not packaged in Alpine Linux?
RUN apk update
RUN apk upgrade
RUN apk add --no-cache ffmpeg
RUN apk add --no-cache mkvtoolnix
RUN apk add --no-cache bento4
RUN apk add --no-cache libxslt

WORKDIR /dashmpd

COPY --from=builder /dashmpd/target/x86_64-unknown-linux-musl/release/dash-mpd-cli /usr/local/bin

# Use an unprivileged user.
USER dashmpd:dashmpd

CMD ["/usr/local/bin/dash-mpd-cli"]