GithubHelp home page GithubHelp logo

Server mount volume about csgo HOT 6 CLOSED

cm2walki avatar cm2walki commented on August 18, 2024
Server mount volume

from csgo.

Comments (6)

CM2Walki avatar CM2Walki commented on August 18, 2024 1

Yeah, I'm aware of it. My thinking behind it was that, in case of a faulty update that causes the container to get stuck in a restart loop, you would be able to just edit the entry.sh because it's located in a volume (and fix the cause of the issue). Rather than having to commit & recreate the container which is always a bit of a hassle imo.

from csgo.

CM2Walki avatar CM2Walki commented on August 18, 2024

I have never worked with Unraid, but I assume you want to expose the STEAMAPPDIR so it can be modified from outside the container?
If that is the case then show me your docker run command, maybe I can help you out by replicating the steps on my server (regular RAID1).

from csgo.

WolfVanH avatar WolfVanH commented on August 18, 2024
$ docker run -d --name='dragonCsGo' --net='host' -e TZ="Europe/Paris" -e HOST_OS="Unraid" -e 'SRCDS_TOKEN'='TOKEN HERE' -e 'TCP_PORT_27015'='27015' -e 'TCP_PORT_27020'='27020' -e 'SRCDS_FPSMAX'='300' -e 'SRCDS_TICKRATE'='128' -e 'SRCDS_MAXPLAYERS'='14' -e 'SRCDS_STARTMAP'='de_dust2' -e 'SRCDS_REGION'='3' -e 'SRCDS_MAPGROUP'='mg_active' -v '/mnt/user/appdata/csgo':'/home/steam/csgo-dedicated':'rw' 'cm2network/csgo:sourcemod'

Unraid works more with GUI templates for docker, so there is a lot of stuff there that's not relevant.

In console it logs the following issue: /bin/sh: 1: /home/steam/csgo-dedicated/entry.sh: not found

from csgo.

CM2Walki avatar CM2Walki commented on August 18, 2024

Yes, this behaviour is intended by docker, the bind-mount follows the documentation in this regard:

"If you bind-mount into a non-empty directory on the container, the directory’s existing contents are obscured by the bind mount." (Source)

This is the reason why the container can no longer find the "entry.sh" inside the container, since the directory is now empty because it was obscured by the host.

What you are looking for is probably this:
You want the bind mount/directory to be shared between host and container. This can be achieved using the following the instructions:

mkdir -p /mnt/user/appdata/csgo
chown 1000 -R /mnt/user/appdata/csgo
docker run -d --name='dragonCsGo' --net='host' -e TZ="Europe/Paris" -e HOST_OS="Unraid" -e 'SRCDS_TOKEN'='TOKEN HERE' -e 'TCP_PORT_27015'='27015' -e 'TCP_PORT_27020'='27020' -e 'SRCDS_FPSMAX'='300' -e 'SRCDS_TICKRATE'='128' -e 'SRCDS_MAXPLAYERS'='14' -e 'SRCDS_STARTMAP'='de_dust2' -e 'SRCDS_REGION'='3' -e 'SRCDS_MAPGROUP'='mg_active' -v '/mnt/user/appdata/csgo':'/home/steam/csgo-dedicated':'rshared' 'cm2network/csgo:sourcemod'

Quick explanation:
We first create the directory to be mounted by the container and change the ownership to uid 1000. This is possible because of CM2Walki/steamcmd#5, which sets the default uid for the base image to 1000. If you don't change the owner, your container won't be able to write to that directory. Lastly, we set the bind mount to rshared to propagate changes both ways.

Is this what you have been looking for?

from csgo.

CM2Walki avatar CM2Walki commented on August 18, 2024

Hmm, it worked with an older image but not with the current one. It appears that part of the issue is that the entrypoint (entry.sh) is located inside the volume. One solution would be to bind the csgo subdirectory (because I assume that is probably what you want to expose since it holds all the maps, configs and addons)

docker run -d --name='dragonCsGo' --net='host' -e TZ="Europe/Paris" -e HOST_OS="Unraid" -e 'SRCDS_TOKEN'='TOKEN HERE' -e 'TCP_PORT_27015'='27015' -e 'TCP_PORT_27020'='27020' -e 'SRCDS_FPSMAX'='300' -e 'SRCDS_TICKRATE'='128' -e 'SRCDS_MAXPLAYERS'='14' -e 'SRCDS_STARTMAP'='de_dust2' -e 'SRCDS_REGION'='3' -e 'SRCDS_MAPGROUP'='mg_active' --user=root -v '/opt/testvol':'/home/steam/csgo-dedicated/csgo':'rshared' 'cm2network/csgo:sourcemod'

from csgo.

biro456 avatar biro456 commented on August 18, 2024

As far as I could understand it, the entry.sh doesn't need to be inside STEAMCMDDIR.
Placing anywhere else should allow binding the volume with read-write.

from csgo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.