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

Support pre/post install hook directories #36

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

joshhsoj1902
Copy link

@joshhsoj1902 joshhsoj1902 commented Sep 30, 2023

Indirectly fixes #25

This change allows users to mount a pre-install and/or post-install directory. Inside these directories users can place .sh scripts which will all be executed either before or after the install step. These directories give users the flexibility to create their own derived docker images with all the customization they may need to reproduce a working custom game server.

Some use cases I have:

  • Setting up a minecraft image that includes all the plugins and custom settings I want, and pinning the MC version so I decide when to upgrade it.
  • Setting up a gmod server with custom assets, fastdl and mods
  • Looking to do something similar to gmod with 7DaysToDie

I have an example repo setup to show how this could be used, https://github.com/joshhsoj1902/docker-linuxgsm-example

@joshhsoj1902 joshhsoj1902 marked this pull request as ready for review September 30, 2023 14:31
@joshhsoj1902
Copy link
Author

A couple shortcomings I've noticed playing with this:

  • If one of the hooks directories exists, but is empty the startup will fail saying it didn't find anything matching *.sh
  • If the pre-install hook creates the /data/serverfiles directory, the entrypoint-user.sh will skip the autoinstall and will do an update instead. For minecraft this means the Eula doesn't get accepted.

@joshhsoj1902
Copy link
Author

GameServerManagers/LinuxGSM#4299 is likely a better option for this feature.

@dgibbs64 and I had a discussion about this https://discord.com/channels/127498813903601664/1080548263977046078/1159224633376120882

I'm going to leave this PR open for now because anyone who wants to create their own Dockerfiles supporting hooks can do so by making similar changes to the most up-to-date entrypoint-user.sh and creating a file that looks like something like this:

FROM gameservermanagers/gameserver:gmod

ADD entrypoint-user.sh /app/entrypoint-user.sh

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.

Add option to support installing mods on startup
1 participant