FROM golang:1.23-alpine AS builder ARG GO_TRANSCODE_COMMIT=f8137e68c7b8da88c51aec9563eec9585c10c723 WORKDIR /src RUN apk add --no-cache git RUN git clone https://github.com/m1k1o/go-transcode.git . \ && git checkout "$GO_TRANSCODE_COMMIT" COPY patches/go-transcode-vaapi.patch /tmp/go-transcode-vaapi.patch RUN git apply /tmp/go-transcode-vaapi.patch \ && gofmt -w hlsvod/manager.go hlsvod/probe.go hlsvod/transcode.go \ && CGO_ENABLED=0 go build -o /go-transcode . # Keep Alpine 3.17: upstream documents an FFmpeg 6 segmenting regression with # newer Alpine releases. Install both Intel and Mesa VAAPI drivers so this also # works if the Unraid host exposes an AMD render device. FROM alpine:3.17 WORKDIR /app RUN apk add --no-cache \ bash \ ffmpeg \ intel-media-driver \ libva-intel-driver \ mesa-va-gallium COPY --from=builder /go-transcode /app/go-transcode EXPOSE 8080 ENV TRANSCODE_BIND=:8080 \ TRANSCODE_VAAPI_DEVICE=/dev/dri/renderD128 ENTRYPOINT ["/app/go-transcode"] CMD ["serve"]