matracey / docker-cod4

Call of Duty 4: Modern Warfare dedicated server. Uses CoD4x server mod. Based on hberntsen/docker-cod4 with a number of enhancements.
6 stars 6 forks source link

Docker-cod4

This repository contains a Docker container for hosting a dedicated server for Call of Duty 4: Modern Warfare with CoD4x server mod. It is based on hberntsen/docker-cod4 with a number of enhancements.

Installation

  1. Clone this repository.
  2. Build the Docker image, e.g. docker build -t matracey/modern-warfare.
  3. Copy the resource files from the main/ and zone/ directories to a directory of your choice on your Docker host.
    • You can omit the main/video directory as this is not needed by the server.
    • For example, use /var/cod4/res, and within it have main, zone, usermaps, and mods.
  4. Run your server! See the example command below.
  5. Connect to your server!

Example Run Command

docker run --user=root -it --name mw \
-p 28960:28960 -p 28960:28960/udp \
-v /var/cod4/res/main:/home/cod4/main \
-v /var/cod4/res/zone:/home/cod4/zone \
-v /var/cod4/res/mods:/home/cod4/mods \
-v /var/cod4/res/usermaps:/home/cod4/usermaps \
-v /var/cod4/server.cfg:/home/cod4/main/server.cfg \
-v /var/cod4/games_mp.log:/home/cod4/main/games_mp.log \
matracey/modern-warfare +set sv_authorizemode '-1' +exec server.cfg +map_rotate

Notes on Building Your Run Command

Volume Mounts Explained

A sample server.cfg file is included in this repository. It is not part of the build, but it can help you create your own configuration.