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

Add dockerfile & docker-compose #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cghislai
Copy link

@cghislai cghislai commented Feb 21, 2019

Here is a dockerfile i thought mught be worth sharing.

You can setup a account on hub.docker.com to build it on each commit.
Users then would be able to copy/adapt the provided docker-compose.yml and deploy a spads service in no time.

There are some issue though:

  • non-interactive mode for the installer is a pain
  • credentials are passed to the command line
  • game/maps have to be provided manually
  • bind-mounting an host directory will 'hide' the image-provided content (using docker volumes works though).
  • host networking mode seems required for the server to be reachable, even if its ip is specified in the config. Spads seems to use a guessed one which is incorrect in nated networks.

@Yaribz
Copy link
Owner

Yaribz commented Mar 19, 2019

Thanks !

Concerning the issues you listed:

  • I can make non-interactive installation easier, conf file based for example. This would fix the credentials passed through command line parameters problem at the same time. I will add that to my todo list if you want.
  • Games/maps can be downloaded automatically using rapid
  • I'm not sure I understand your last point. SPADS only uses automatic IP address detection for local LAN IP address, which is only used in case of clients connecting from same LAN. And this can be bypassed by manually setting the IP address in the localLanIp setting in spads.conf anyway. All other network related configurations are managed by the Spring server binary itself. You might want to take a look at the forceHostIp setting though, which forces the spring server binary to bind to a specific IP address/version in case it fails to detect/use the good one.

@cghislai
Copy link
Author

Thanks for your feedback.

  • Indeed conf-based installation would be great.
  • I will look into downloading games through rapid and providing the tools to do so easily, and auto download new archives if possible.
  • For the last point, i will recheck with regards to your explanation.
    In docker, a container gets a 'random' local ip address on startup. traffic is natted through the docker daemon from the host interface to the docker container interface. So the spring engine should advertize itself using the host ip:port, while listening on a possibly different ip:port.
    I tried setting the host ip in the config, but that did not work. If spads makes some assumption based on the ip address (ie it assumes it is on a lan if the ip is in the private ranges), then this might be an issue in dockerized environment. Otherwise this must be an issue with the spring engine or a config issue.

@Yaribz
Copy link
Owner

Yaribz commented Mar 22, 2019

Given your explanations, I think the problem is just due to the exposed port (port on the host interface, reachable from Internet) being different from the port on which the spring server binary is listening (port in the docker container). I don't think it has anything to do with the IP addresses actually.

The listening port for the spring server can be configured in SPADS using the port hosting setting. This setting is used both to indicate which port the spring server binary must listen on and which port the clients must connect to (by sending the appropriate "port" parameter in the OPENBATTLE Spring lobby command). The problem, when using docker, is that these 2 ports can be different... One way to deal with the problem would be to force the internal port to be mapped to the same external port if possible. Another way, if the external port can be known in advance, would be to make a SPADS plugin which would allow configuring the spring binary to listen on one port and publish a different port on Spring lobby server...

@Yaribz
Copy link
Owner

Yaribz commented Jun 16, 2019

I added support for fully automatic/unattended install in spadsInstaller.pl version 0.23 (only in unstable SPADS release for now), check this for more information.

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

Successfully merging this pull request may close these issues.

2 participants