├── README.md ├── LICENSE └── Dockerfile /README.md: -------------------------------------------------------------------------------- 1 | cs16_server Dockerfile 2 | =========== 3 | 4 | CounterStrike 1.6 Dedicated Server Docker Image 5 | 6 | This dockerfile uses the Daniel Gibbs' [linuxgameservers scripts](https://github.com/dgibbs64/linuxgameservers) to start an instance of Valve's CounterStrike 1.6 linux server. Settings passed onto the server during runtime (such as defaultmap and servername) are environment variables that can be overriden when creating the Docker instance. 7 | 8 | TODO: 9 | * Instructions 10 | * A mechanism to copy maps and deeper config files into the new instances. (probably through ADD commands) 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 skarademir 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian 2 | MAINTAINER Saruhan Karademir 3 | 4 | ENV DEFAULTMAP de_dust2 5 | ENV MAXPLAYERS 16 6 | ENV PORT 27015 7 | ENV CLIENTPORT 27005 8 | ENV SERVERNAME servername 9 | ENV RCONPASS rconpass 10 | 11 | EXPOSE $PORT/udp 12 | EXPOSE $CLIENTPORT/udp 13 | EXPOSE $PORT 14 | EXPOSE $CLIENTPORT 15 | EXPOSE 1200/udp 16 | 17 | RUN dpkg --add-architecture i386 18 | RUN apt-get update && apt-get -qqy install gdb mailutils postfix tmux ca-certificates lib32gcc1 wget 19 | 20 | # script refuses to run in root, create user 21 | RUN useradd -m csserver 22 | RUN adduser csserver sudo 23 | USER csserver 24 | WORKDIR /home/csserver 25 | 26 | # download Counter-Strike 1.6 Linux Server Manager script 27 | RUN wget http://danielgibbs.co.uk/dl/csserver 28 | RUN chmod +x csserver 29 | 30 | # Install the server (interactive script requires piping of input) 31 | # Likes to fail so I run it twice 32 | RUN printf "y\ny\nn\ny\ny\ny\ny\nn\n${SERVERNAME}\n${RCONPASS}\n" | ./csserver install 33 | RUN printf "y\ny\nn\ny\ny\ny\ny\nn\n${SERVERNAME}\n${RCONPASS}\n" | ./csserver install 34 | 35 | # To edit the server.cfg or insert maps 36 | # we will need to some work with files 37 | # this is where it will go 38 | 39 | 40 | # Start the server 41 | WORKDIR /home/csserver/serverfiles 42 | ENTRYPOINT ../csserver update && ./hlds_run -game cstrike -strictportbind -ip 0.0.0.0 -port $PORT +clientport $CLIENTPORT +map $DEFAULTMAP -maxplayers $MAXPLAYERS 43 | --------------------------------------------------------------------------------