SteamRE / DepotDownloader

Steam depot downloader utilizing the SteamKit2 library.
GNU General Public License v2.0
1.98k stars 268 forks source link

Unable to run linux version with dotnet docker image #457

Closed AndreBaumeier closed 1 year ago

AndreBaumeier commented 1 year ago

What did you expect to happen?

I am trying to run the latest linux version of DepotDownloader (https://github.com/SteamRE/DepotDownloader/releases/download/DepotDownloader_2.5.0/DepotDownloader-linux-x64.zip) within a Docker container. I am using the mcr.microsoft.com/dotnet/runtime:6.0 (also tried sdk). Docker files seem to be fine, but the execution errors. I expected it to run DepotDownloader

Instead of that, what actually happened?

Errors out:

Cannot use file stream for [/opt/app/DepotDownloader.deps.json]: No such file or directory
A fatal error was encountered. The library 'libhostpolicy.so' required to execute the application was not found in '/opt/app/'.
Failed to run as a self-contained app.
  - The application was run as a self-contained app because '/opt/app/DepotDownloader.runtimeconfig.json' was not found.
  - If this should be a framework-dependent app, add the '/opt/app/DepotDownloader.runtimeconfig.json' file and specify the appropriate framework.

Which operating system are you running on?

Linux

Version

2.5.0

Relevant log output

No response

Additional Information

Dockerfile:

# Stage 1: Download DepotDownloader and set up
FROM alpine:latest AS downloader

RUN apk update && apk add --no-cache wget unzip

WORKDIR /app

RUN mkdir /app/DepotDownloader \
    && wget -O /app/DepotDownloader/DepotDownloader-linux-x64.zip https://github.com/SteamRE/DepotDownloader/releases/download/DepotDownloader_2.5.0/DepotDownloader-linux-x64.zip \
    && unzip /app/DepotDownloader/DepotDownloader-linux-x64.zip -d /app/DepotDownloader \
    && rm /app/DepotDownloader/DepotDownloader-linux-x64.zip

# Debug: List files in the downloader stage
RUN ls -la /app/DepotDownloader

# Stage 2: Final runtime image
FROM mcr.microsoft.com/dotnet/runtime:6.0

WORKDIR /opt/app

# Copy DepotDownloader from the downloader stage
COPY --from=downloader /app/DepotDownloader/DepotDownloader /opt/app/DepotDownloader.dll

# Set the entrypoint to execute DepotDownloader with mono
ENTRYPOINT ["dotnet", "/opt/app/DepotDownloader.dll"]

# Debug: List files in the final image
RUN ls -la /opt/app/

What am I doing wrong here?

yaakov-h commented 1 year ago

Don't rename a self-contained Linux executable to a .dll file. Just execute it.

xPaw commented 1 year ago

To clarify: it's a standalone build, it does not require dotnet at all.