DarkRiftNetworking/DarkRift

Docker build doesn't work

Closed this issue · 1 comments

Quick Description

I'm trying to create a docker image to run DarkRift server (version 2.7.0) but it doesn't work. I get the following error, which is generated indefinitely:

[Error]   CommandEngine         Unable to find an appropriate handler for the command.
                                 System.ArgumentNullException: Value cannot be null.
                                 Parameter name: source
                                    at System.Linq.Enumerable.Contains[TSource](IEnumerable`1 source, TSource value, IEqualityComparer`1 comparer)
                                    at DarkRift.Server.CommandEngine.GetIntendedPlugin(String command) in C:\Users\jamie\Documents\Projects\darkrift-2\DarkRift.Server\CommandEngine.cs:line 198
                                    at DarkRift.Server.CommandEngine.FindCommand(String command) in C:\Users\jamie\Documents\Projects\darkrift-2\DarkRift.Server\CommandEngine.cs:line 114
                                    at DarkRift.Server.CommandEngine.HandleCommand(String command) in C:\Users\jamie\Documents\Projects\darkrift-2\DarkRift.Server\CommandEngine.cs:line 53

Explanation

This is my Dockerfile:

FROM mcr.microsoft.com/dotnet/core/runtime:2.1

WORKDIR /app
COPY . .

WORKDIR /app/Lib
EXPOSE 4296/udp
EXPOSE 4296/tcp

ENTRYPOINT [ "dotnet",  "DarkRift.Server.Console.dll" ]

The above Dockerfile is created for .Net Core version of the server. I tried the .Net Framework version and used mono instead to build the image, but I still get the same issue. I also built an ubuntu image, installed dotnet runtime and sdk, but to no avail.

I did not add any plugins to the server, so that is not the cause for sure.

Any help is appreciated. Thanks!

Apparently, I needed to enable tty when running the container. It's working now.

In docker-compose.yaml it'll be like this:

version: "3"

services:
  game_server:
    image: game_server:latest
    build:
      context: ./game_server
    tty: true