Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI: Docker Image #1250

Open
2 tasks done
MoergJ opened this issue Nov 10, 2024 · 4 comments
Open
2 tasks done

CLI: Docker Image #1250

MoergJ opened this issue Nov 10, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@MoergJ
Copy link

MoergJ commented Nov 10, 2024

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 MoergJ added the enhancement New feature or request label Nov 10, 2024
@superbonaci
Copy link
Contributor

What's the point of this?

@MoergJ
Copy link
Author

MoergJ commented Nov 11, 2024

What's the point of this?

To have a short lived container run the CLI command you want it to, without having to install the CLI on the host itself.
Could be further used for larger orchestration of download jobs, e.g. I was looking to see, if I could use it to backup channels I frequently watch continuously.

Or did I misunderstand your question?

@superbonaci
Copy link
Contributor

I get it, it's like venv in python. You should improve the docker file to include all architectures and for Windows the UI.

@MoergJ
Copy link
Author

MoergJ commented Nov 11, 2024

I get it, it's like venv in python. You should improve the docker file to include all architectures and for Windows the UI.

It is not exactly like that.
Containers are mainly linux based, other platforms like windows are technically possible, but rarely ever used. It is especially useful in server deployed services. The UI, as I understood it (haven't used it yet) is a WPF application, which is not suited to be placed inside a container.

If it was a web based service, that would perfectly make sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants