question

Gabriel Dechichi avatar image
Gabriel Dechichi asked

How to use and test ContainerRunCommand on Linux container with Multiplayer Server 2.0?

I've been having a hard time trying to pass extra command line arguments to a linux container running on Multiplayer Server 2.0.

The container is build with docker and has a default ENTRYPOINT define in the DockerFile, but I'd like to pass extra flags depending on the build configuration, without having to build an entire new image. Reading through the docs I've found that ContainerRunCommand may be what I'm looking for, but it's unclear how this command actually works (does it override the image's entrypoint?).

Is there any examples I could look at to use this?

Thanks,

Gabriel

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brandon@uprootstudios.com avatar image
brandon@uprootstudios.com answered

@Gabriel Dechichi

We use ContainerRunCommand in our Linux containers to start our server assets inside the container.

Here's an example of what we do:

1. We have a container image that is plain Ubuntu:Latest with cURL installed

2. We upload our Server asset and set the mount point to /data/Assets/

3. We use the ContainerRunCommand to start our Server

4. Example of our ContainerRunCommand:

"chmod +x /data/Assets/GameServer.x86_64;/data/Assets/GameServer.x86_64 -batchmode -nographics -logFile /data/GameLogs/Server.log"

This does a few things:

- Marks our Server application as 'Executable'

- Runs our Server application with arguments (-batchmode -nographics to run headless, and -logFile to output our Server's log to /data/GameLogs/)

I made a tool to make creating containers, uploading server builds, and deploying Linux configurations (with GUI or CLI) if it's of any interest to you: https://github.com/bphillips09/PFAdmin

Here's an example build configuration that may help.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Steve Lobdell avatar image Steve Lobdell commented ·

I pulled my hair out for like a week trying to figure out why my windows builds would work but couldn't start Linux. I wasn't executing the chmod +x on it first!!! So thanks, you accidentally fixed my problem!

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.