Freeorion server in docker?

Problems and solutions for installing or running FreeOrion, including discussion of bugs if needed before posting a bug report on GitHub. For problems building from source, post in Compile.

Moderator: Oberlus

Post Reply
Message
Author
User avatar
human2
Pupating Mass
Posts: 97
Joined: Tue Mar 10, 2020 3:22 am
Location: USA, Utah, Salt Lake City

Freeorion server in docker?

#1 Post by human2 »

I'm just learning how to use Docker and I thought it would be interesting to see if I could get the freeorion server to run in a docker container. I tried to setup a Dockerfile and docker-compose file but they don't work. I am hoping someone who understands both better than I could help me out.

https://github.com/magnusviri/freeorion-server-docker

I'm running Docker Desktop on a Mac and I'm hoping to connect to it with my Mac. If I could get this to work I could put this anywhere.

James

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Freeorion server in docker?

#2 Post by Ophiuchus »

if you want to run the freeorion server this might be good idea. make the necessary ports accessible. add the necessary start command. also learn how to enter a running docker container to have a look what is actually happening.

if you have it running connect from a client to the server.

for running a GUI client, docker is usually a bad choice (especially for someone who just started).
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

User avatar
human2
Pupating Mass
Posts: 97
Joined: Tue Mar 10, 2020 3:22 am
Location: USA, Utah, Salt Lake City

Re: Freeorion server in docker?

#3 Post by human2 »

This would be for the server. I've actually gotten X11 forwarding to work with the Brave Browser but it always crashes. I don't see much advantage to running a GUI in Docker until this type of thing gets official support from Docker and the software vendors.

My port mapping is 12346:12346. Is this correct?

I should've been clearer in my first post. When I install and run freeorion inside of a Ubuntu 20.04 container this is what I get.

root@a2e3f3765915:/# /usr/lib/freeorion/freeoriond
Segmentation fault

I have no idea how to debug this. Do I need to build it from source and then run it in gdb or something? It's been a long time since I've used gdb...

User avatar
human2
Pupating Mass
Posts: 97
Joined: Tue Mar 10, 2020 3:22 am
Location: USA, Utah, Salt Lake City

Re: Freeorion server in docker?

#4 Post by human2 »

Hm, I installed freeorion on Lubuntu 20.04 and it crashed too. And then I found out it was 0.4.8. So I installed the snap version, which was 0.4.10.1. Then I checked the version in the Docker container and it was 0.4.8.

So I really need to figure out how to get 0.4.10.1 in a container. I'm trying to get snap working in a Docker container now.

I have a whole new problem though. I'll start a new thread.

o01eg
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: Freeorion server in docker?

#5 Post by o01eg »

You could try to install 0.4.10.1 from PPA https://launchpad.net/~o01eg/+archive/u ... ion-stable
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

User avatar
human2
Pupating Mass
Posts: 97
Joined: Tue Mar 10, 2020 3:22 am
Location: USA, Utah, Salt Lake City

Re: Freeorion server in docker?

#6 Post by human2 »

o01eg wrote: Wed Feb 17, 2021 4:37 am You could try to install 0.4.10.1 from PPA https://launchpad.net/~o01eg/+archive/u ... ion-stable
That works! But now I get this error:

Code: Select all

/usr/lib/freeorion/freeoriond --hostless --network.server.unconn-human-empire-players.max 0 --network.server.conn-human-empire-players.min 0
terminate called without an active exception
Aborted
It did the same thing when I installed it on Lubuntu, so I don't think it's the container.

Anyway, I looked it up and found this.

https://stackoverflow.com/questions/738 ... -exception

I would have no idea what to do about it. I learned C++ in a class 25 years ago but haven't really touched it since. I haven't looked at the FreeOrion code either.

o01eg
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: Freeorion server in docker?

#7 Post by o01eg »

Could you get logs from docker? You could use argument --log-file <path> to write log in desired location.
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

User avatar
human2
Pupating Mass
Posts: 97
Joined: Tue Mar 10, 2020 3:22 am
Location: USA, Utah, Salt Lake City

Re: Freeorion server in docker?

#8 Post by human2 »

I got it to work. Now I can play FreeOrion in the cloud. :D

I moved it here. https://github.com/magnusviri/dockerfil ... /freeorion

Save Game and Concede are greyed out though. It seems to save anyway? Is that because the first person to join has the option set to save?

Also, it seems like the only way to reload an old game (like, say I get destroyed and want to go back and try again) is to restart the whole thing. Does that sound about right?

User avatar
human2
Pupating Mass
Posts: 97
Joined: Tue Mar 10, 2020 3:22 am
Location: USA, Utah, Salt Lake City

Re: Freeorion server in docker?

#9 Post by human2 »

o01eg wrote: Thu Feb 18, 2021 4:52 am Could you get logs from docker? You could use argument --log-file <path> to write log in desired location.
I fixed it with what I posted on this thread: viewtopic.php?f=2&t=10942&start=135

o01eg
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: Freeorion server in docker?

#10 Post by o01eg »

human2 wrote: Thu Feb 18, 2021 6:35 am Save Game and Concede are greyed out though. It seems to save anyway? Is that because the first person to join has the option set to save?
Yes, it saves itself because of hostless options. Any players connected don't become host so they cannot save games.

To manage save you can provide next options to the server:
  • --save.auto.hostless.enabled - set to 1 to save each turn
  • --save.auto.exit.enabled - set to 1 to save when shutdown freeoriond
  • --save.auto.interval - automatically save each seconds
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

Post Reply