Sign in to follow this  
Followers 0
AntiMomentum

CE server with SAPP 10.2.1 - Linux- Docker

Here's the github: www.halopc.org

 

To install Docker on Ubuntu 18:
apt install docker.io -y

To install Docker on Debian 9:
https://github.com/antimomentum/haloce/blob/master/InstallDockerDebian.sh

From there you could actually start running a halo server, example:

docker run -it -p 2302:2302/udp --cap-drop NET_RAW --cap-drop NET_BIND_SERVICE antimomentum/halo


The dockerfile is used to build your own Halo containers. It assumes your halo server files use the -path switch, as if you had all your halo files in one folder on Windows. Name that folder "halopull" and put it inside the github cloned directory, which can be cloned by doing:
git clone https://github.com/antimomentum/haloce.git
 

If you don't have git:
apt-get install git

with halopull inside the haloce directory, run this command to build your own container:

docker build -t yourname/yourcontainer .

Then you can test run it:

docker run -it -p 2302:2302/udp yourname/yourcontainer


multiports.sh will generate other dockerfiles in the haloce directory for you if you don't want your halo server using the default 2302 port, which is often the case when running multiple halos from the same server:
https://github.com/antimomentum/haloce/blob/master/multiports.sh

A few examples to use a different dockerfile to build containers, rather than the default "dockerfile":
docker build -t yourname/yourcontainer4 -f Dockerfile-port2304 .

docker build -t yourname/yourcontainer6 -f Dockerfile-port2306 .

You can push your own containers to Docker. Make a Docker account (free is fine).
Then do:
docker login

After you're logged in push your containers:
docker push yourname/yourcontainer

docker push yourname/yourcontainer4
docker push yourname/yourcontainer6

With your containers pushed you can then download them to other servers that have docker installed by either using the docker pull command, or the docker run command like in the antimomentum/halo at the top of this post :)




Keep in mind that whatever port you build the container with is the port you must use in the docker run command too. If you plan on making a bunch of containers I recommend using Dockerfile-compose to build them, and then install docker-compose. Or build them with the port number in the Dockerfile each time you build a container.
For example my containers use the map and port they are built with in the names:

antimomentum/mario-race-port2308
antimomentum/halo-deep-ocean-port2306

antimomentum/icelandic-tundra-port2304



Further information for multiple halos on the same server:

Since each halo console will take up a screen in command line you can do this when you start your halo containers instead:
docker run -itd -p 2302:2302/udp yourname/yourcontainer

then do this to get the containers running name:
docker ps

with "laughing_zebra" as an example generated running container name (they are different each time a container starts):
docker attach --detach-keys z laughing_zebra

That will attach you to the halo console. Press "z" to detach again. 


If you plan on using mutliple halo servers on the same server I recommend using docker-compose instead. Further info about compose can be found on the github:
https://github.com/antimomentum/haloce

Share this post


Link to post
Share on other sites

Tiddy-bits:

You can use the deobfuscated SAPP binaries with a newer Wine rather than using the released binaries with an older Wine. They are in the SAPP thread on this forum.

 

I'd also like to add that you should never run this game as root for any reason ever, you are asking for trouble if you do this. I would not even suggest it as an option.

Edited by Vaporeon
add warning

Share this post


Link to post
Share on other sites
On 10/1/2020 at 2:07 AM, Vaporeon said:

You can use the deobfuscated SAPP binaries with a newer Wine rather than using the released binaries with an older Wine. They are in the SAPP thread on this forum.

 

I'd also like to add that you should never run this game as root for any reason ever, you are asking for trouble if you do this. I would not even suggest it as an option.


So far the resource usage is light with 6 containers running. Granted, I'll know more at a time when players are on to fill at least one or two of the halo servers up.  I'm less concerned with install size personally.

And yes, to be perfectly clear, running as root is opening up to attack. Configuring it to not require root will be the next step for this project. At this point it is functional not secure. It's certainly not in a state where someone would want to set up a server and leave it.

*Edit 10/2*
I put an edit in op, but the antimomentum/haloce container now runs 10.2.1 with UPX removed.

Edited by AntiMomentum

Share this post


Link to post
Share on other sites
11 hours ago, Vaporeon said:

You can use the deobfuscated SAPP binaries with a newer Wine rather than using the released binaries with an older Wine. They are in the SAPP thread on this forum.

 

I'd also like to add that you should never run this game as root for any reason ever, you are asking for trouble if you do this. I would not even suggest it as an option.

Deobfuscated binaries? Where are these avaliable at?

 

@OP

Maybe I'm retarded but whats the point of using docket for this? Getting kind of annoyed about everything being packaged in this or that way, using this software to run, etc. Is it just to make it easier for normies to run?

Edited by Enclusion

Share this post


Link to post
Share on other sites
1 hour ago, Enclusion said:

@OP

Maybe I'm retarded but whats the point of using docket for this? Getting kind of annoyed about everything being packaged in this or that way, using this software to run, etc. Is it just to make it easier for normies to run?


No worries. Even plenty of admins I've talked too have only heard the name Docker lol. There are different uses, but being able to have the same environment and quickly is generally the idea. Like virtual machines. Especially useful for software developers, if they write code in one version of an OS they don't necessarily have to worry about it working in others. But in this case for example if you built images of your own halo servers and the game dns master server never goes down, your image will always work on a basic linux machine with internet (there are probably exceptions of course). 

You can even take the automation further with docker-compose.
So say you have 6 different halo servers. You've built an image for each one. You'll never have to do that part again. From there on a fresh host linux install they can all be running in about 4 commands after you copy in the yml. apt update, apt install docker, apt-get install docker-compose, docker-compose up lol (My docker-compose file isn't working. After I deal with the root account issue I'll be fixing up the docker-compose.yml). The halo servers themselves don't have to worry about talking with each other. Docker handles the container networking. They are separate from each other as far as they know which can actually make things easier. 

Even in just network administration it's nice. Because once you have the containers' own network(s) set up that's generally done too even if you are using the same containers in different physical host machines with seperate networking info.

Now imagine you're big data like Google. You now use Kubernetes to control your docker-compose/containers on a vast scale. Load balancing, containerizing databases, controlling hardware resources, ect. A developer pushes a code update, Kubernetes updates the containers safely and you move on. A user makes a new account and the account is accessible from anywhere quickly. Kubernetes takes extra configuration too though. I've never used it. But this is one way that sort of stuff happens

Edited by AntiMomentum

Share this post


Link to post
Share on other sites
On 11/8/2020 at 8:22 PM, Davidblacky said:

Hello! how can i stop docker to configure my server?


docker ps
will show running docker container names
then do:

docker stop ContainerName

with ConainerName being whatever you got from docker ps


In the halo server console you can just do:

quit

and it should stop the container as well 

Enclusion likes this

Share this post


Link to post
Share on other sites

Might be interesting to set it up where if your server gets a certain playercount (full server for example) it would automatically create a new server using the same settings, possibly with an incremented server name. I might try to do that myself but just throwing the idea out in case you or someone else wants to try first.

AntiMomentum likes this

Share this post


Link to post
Share on other sites
On 1/14/2021 at 7:01 PM, Enclusion said:

Might be interesting to set it up where if your server gets a certain playercount (full server for example) it would automatically create a new server using the same settings, possibly with an incremented server name. I might try to do that myself but just throwing the idea out in case you or someone else wants to try first.


A lua script behind sapp outputting whatever string to a file when the player count hits 16, and a shell script watching that file for the string and running "docker run" might work. The Lua script would need to remove/replace the string when player count drops below 16 or whatever.

Idk how to do the lua part though. Or how to scale it off the top of my head past a 2nd server in the shell script im not advanced with shell or anything. Suppose it would have to get the player count from a container it spawned too or somehow otherwise limit itself.

Edited by AntiMomentum
Enclusion likes this

Share this post


Link to post
Share on other sites
On 10/1/2020 at 2:07 AM, Vaporeon said:

I'd also like to add that you should never run this game as root for any reason ever, you are asking for trouble if you do this. I would not even suggest it as an option.


Well it's been a long time but here it is:

https://github.com/antimomentum/haloce/tree/master/Docker/rootless

 

 

I can't say Ubuntu 20.04 would be my first choice. But it's the only rootless install that's worked for me so far.

Also unlike ufw, Docker is unable to bypass my firewall with its iptables rules. Since rootless Docker doesn't have port or iptables privileges it might not bypass ufw though.

Java and Enclusion like this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0
  • Recently Browsing   0 members

    No registered users viewing this page.