Skip to content

LSL1337/call-of-duty-2-docker-server

 
 

Repository files navigation

Docker Build Status Docker Pulls

Call of Duty 2 server meets docker

Launch a minimal & lightweight containarized Call of Duty 2 multiplayer game server, including libcod.

📦 Supported tags and respective Dockerfile links

🔧 What's inside

  • The cod2_lnxded_1_3_nodelay_va_loc server binary from Killtube by Kung Foo Man, Mitch and anyone that contributed;
  • The custom libcod from Voron00, follow the repository forks for a complete list of creators and contributors.

Full credits goes to them for their awesome work !

📝 Requirements

  1. The orginal game, as it's content is used by the dedicated server;
  2. A host machine of your choice with x86_64 architecture;
  3. Docker and Docker Compose installed and configured on your host machine. Minimal knowledge in using both is recommended.

🚀 Usage

Setup the server

  1. Clone or download this repository on your host machine;
  2. Copy the required data from the game to the server:
    1. Go in the main folder of your original game (install directory or retail DVD);
    2. Copy all the iw_XX.iwd from 00 to 15 to the cod2server/main folder;
    3. Copy all the localizations localized_english_iwXX.iwd to the cod2server/main (it might be another language).
  3. Edit the config file located in cod2server/main/config.cfg to suits your needs:
    • [MANDATORY] Set the RCON password to something strong and private!
    • Tweak the rest as you see fit, don't forget to updated the placeholders (server name, admin, etc).
  4. Depending on your setup, you might have some port-forwarding and firewalling to do in order to make your server publicly available (see required open ports in the EXPOSE section of the Dockerfile).

Launch the server

From the project root:

docker-compose up -d

Server interactions

From the project root, you can:

  • Restart the server (to pick up config change for instance):
    docker-compose restart
  • Tail the server logs:
    # cod2_server refer to the name of the service in the compose file
    docker-compose logs -f cod2_server
  • Attach a shell to the server to run commands (see available commands in /doc/readme.md):
    docker container attach call-of-duty-2-docker-server_cod2_server_1
    # exemple commands
    status
    map_rotate
    # Use the escape sequence to detach: `CTRL+P`, `CTRL+Q`
  • Completely stop the server:
    docker-compose down

💻 Development guidelines

If you wish to contribute to and improve this project, you can do so by cloning it and then follow theses guidelines :

Start / restart the server locally

./scripts/dev-up.sh

Note that you will need the game files in the main folder, as specified in the "Requirements" section.

Show server logs

./scripts/dev-logs.sh

Execute server commands

Attach a shell to the running server to run a command (see available commands in /doc/readme.md):

./scripts/dev-attach.sh
# Exemple commands
status
map_rotate
# Use the escape sequence to detach: `CTRL+P`, `CTRL+Q`

Cleanup

Remove everything once your tests are over:

./scripts/dev-down.sh

🗂️ Notes & resources

  • This setup was tested on an ubuntu server 18.04.3 LTS x86_64 and should work on any platform with the same architecture.
  • Threads on setting up a cod2 server are availables on Killtube:
  • There is a similar repository on github proposing a Call of Duty 2 server based on CentOS: hberntsen/docker-cod2
  • Original and cracked server binaries can be found in the bin folder, have a look at the readme
  • If you need to use iptables in conjonction with Docker, please follow the official documentation tips

🚧 Roadmap

Project roadmap & issues can be tracked on the project page.

🙏 Contribution

Any contribution to this project is welcome ! Feel free to open an issue to ask for help or a new feature, and it will be discussed there.

If you wish to contribute to the code, start by reading the development guidelines and then feel free to open a pull-request.

📖 License

This project is under the MIT License.

About

Minimal & lightweight Call of duty 2 server docker image - include libcod library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Dockerfile 82.1%
  • Shell 17.9%