TwitchDownloader icon indicating copy to clipboard operation
TwitchDownloader copied to clipboard

CLI: Docker Image

Open MoergJ opened this issue 3 months ago • 4 comments

Checklist

Write your feature request here

I found this project today, played around and took a few minutes to build a Dockerfile. It works for me, but I don't have the time to create a PR or continuously contribute, so just in case someone needs a simple but working Docker image for the CLI (x64, not ARM) here it is.

# Build binaries
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /App
# Copy projects
COPY ./TwitchDownloaderCore ./TwitchDownloaderCore
COPY ./TwitchDownloaderCLI ./TwitchDownloaderCLI
# Restore
RUN dotnet restore TwitchDownloaderCLI
# Build and publish
RUN dotnet publish TwitchDownloaderCLI -p:PublishProfile=Linux -o out

# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:6.0
WORKDIR /App
# Copy built Binary
COPY --from=build /App/out/TwitchDownloaderCLI .
# Let TwitchDownloaderCLI download FFMPEG
RUN ./TwitchDownloaderCLI ffmpeg -d
ENTRYPOINT ["./TwitchDownloaderCLI"]

Put in the repo's root and built using docker build -t <image name>:<tag> .

MoergJ avatar Nov 10 '24 15:11 MoergJ