CM2Walki / CSGO

Dockerfile for automated build of a CS:GO gameserver: https://hub.docker.com/r/cm2network/csgo/
https://CM2.Network
MIT License
248 stars 74 forks source link

Shut down server without shutting down the container #3

Closed Saltzmann closed 5 years ago

Saltzmann commented 5 years ago

Hi,

So I'd like to install sourcemod and Metamod:Source on top of this server to in the end install the splewis practice mod plugin. The instructions say that you should shut down your server for the installation which makes sense for me but how do I do that? I tried killing processes called csgo/src but that instantly shut down the server. Any ideas? Thank you!

CM2Walki commented 5 years ago

There's multiple approaches to that. However, I do believe you can just move the files into the directory and then after that restart the server. Linux doesn't have the problem in which you can't overwrite files that are currently in use. It just overwrites and keeps the file until the last handle on it is closed.

If you want to do it following the instructions. You can shut down the container and access the mounted volume. You can find that volume using:

docker inspect csgo-dedicated

  1. In the output find: "Mounts": [
  2. In that find: "Destination": "/home/steam/csgo-dedicated",
  3. Find the "Source": "/var/lib/docker/volumes/70340c1c81f1e61f487a3272311e3024a60f8ecb0c08f93498499235b3f43c12/_data"
  4. Change directory to the "Source" path: "cd /var/lib/docker/volumes/70340c1c81f1e61f487a3272311e3024a60f8ecb0c08f93498499235b3f43c12/_data"
  5. Make whichever modifications you like
  6. Restart the container
Saltzmann commented 5 years ago

I'll give it a try and will be back once I found if I can get it to work this way. Thank you!

Saltzmann commented 5 years ago

Hello again, so generally it seems to work fine. I still have some bugs to debug but I am pretty certain they have nothing to do with your Dockerfile/Image. May I still suggest adding this approach to the readme for others to see? I think this is a common use case that you would want to modify the server files in some way. Thank you.

CM2Walki commented 5 years ago

I will add a metamod & sourcemod and a metamod & amxmod image. That should cover it.

Saltzmann commented 5 years ago

that's awesome thanks a lot! Where will I be able to find these images later on?

CM2Walki commented 5 years ago

@Saltzmann It's done. You can now directly run a CSGO server with metamod or both metamod and sourcemod. I also upgraded the base image to buster-slim.