question

Spencer avatar image
Spencer asked

How can I add command line arguments to an Unreal Linux container Dockerfile?

Hello. I am trying to go from windows process servers to Linux containers and had a question about the Dockerfile. Currently our start command looks like

WindowsServer\MVServer.exe LVL_Downtown_TheSlums?game=/Game/Game/Blueprints/GameModes/Online/BP_FreeRoam_GM.BP_FreeRoam_GM_C -log -NOSTEAM

When I try to set up the docker file with the ".sh" file and the arguments it fails to launch. I believe it does not like having the arguments in the command line because(maybe because of the special characters?) If I use

CMD chown -R ue.ue $PF_SERVER_LOG_DIRECTORY && su ue -c ./MVServer.sh

it will launch but I need the arguments to run properly. If I use

CMD chown -R ue.ue $PF_SERVER_LOG_DIRECTORY && su ue -c ./MVServer.sh SomeRandomWord

It will also launch but the arguments do not get passed into Unreal. So my question is how can I add command like arguments to my launch command in the CMD line of the Dockerfile? Thanks.

unrealmultiplayer
2 comments
10 |1200

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

Austin Brunkhorst avatar image Austin Brunkhorst commented ·

Can you give an example of the start command on Linux that works when run directly in a terminal? i.e. not in the Dockerfile

0 Likes 0 ·
Xiao Zha avatar image Xiao Zha Austin Brunkhorst commented ·

Can you tell me what parameters are there? Are they Unreal's parameters or your own?

0 Likes 0 ·

1 Answer

·
Spencer avatar image
Spencer answered

The solution was to put the shell script and the arguments in quotation marks. The issue was using something like Unreal's -log parameter for example was getting interpreted as -l by the su command. Anytime I tried to use a "-" after the the shell script it would fail.

Here is the final working CMD line of the Dockerfile:

CMD chown -R ue.ue $PF_SERVER_LOG_DIRECTORY && su ue -c "./MVServer.sh LVL_Downtown_TheSlums?game=/Game/Game/Blueprints/GameModes/Online/BP_FreeRoam_GM.BP_FreeRoam_GM_C -log -NOSTEAM -PlayFabTitleID=omitted -PlayFabSecretKey=omitted"
10 |1200

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

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.