Giter VIP home page Giter VIP logo

docker-l4d2-server's Introduction

Left 4 Dead 2 Dedicated Server + Docker License

L4D2 server in docker

Docker hub image

DockerHub

docker pull jackzmc/srcds-l4d2

Tag Descriptions / Dockerfile Links

  • Latest - The latest, full game image.
  • Bare - Does not contain a predownloaded game image, must be installed on start
  • Sourcemod - Contains bare version with sourcemod preinstalled
  • Sourcemod-full - Contains full version with sourcemod preinstalled

Envs:

USER - username for /home/ dir (default: steam)
SERVER - where to store data files (steamcmd & csgo dir, defaults to /home/$USER/server )

Details:

You can create new Dockerfile based on that image and customize it with plugins, configs, CMD and ENTRYPOINT instructions.

Also you can create volumes with the -v flag that point to the host for these directories:

  • /data/addons - Copied to the left4dead2 addon folder on start (left4dead2/addons)
  • /data/configs - Copied to the game's configs folder (left4dead2/cfgs)
  • /data/sm-plugins - Copied to sourcemod plugins folder
  • /data/sm-configs - Copied to sourcemod configs folder

Examples

# Generic Server
docker run -it -p 27015:27015 -p 27015:27015/udp jackzmc/srcds-l4d2:[tag-name] -usercon +map c8m1_apartment
# add extra cvars at the end

# Setting hostname or any variables with spaces
# You should enclose it with quotes (\"), for example:
docker run -it -p 27015:27015 -p 27015:27015/udp jackzmc/srcds-l4d2:[tag-name] -usercon +hostname "\"My Server With Spaces\""

# Versus Server
docker run -it -p 27015:27015 -p 27015:27015/udp jackzmc/srcds-l4d2:[tag-name] -usercon +map c8m1_apartment versus +sv_gametypes "VERSUS" 

# Run a server with sourcemod configs & plugins
docker run -it -p 27015:27015 -p 27015:27015/udp -v /home/jackz/sourcemod-plugins:/data/sm-plugins -v /home/jackz/sourcemod-configs/configs:/data/sm-configs jackzmc/srcds-l4d2:sourcemod -usercon +map c8m1_apartment 
#you can also use sourcemod-full if you are going to be restarting it often

Building Docker Images

The bare and sourcemod branches should contain all elements you need to build the image, but the master/latest branch will require you to have a cache copy of l4d2 installed. This folder should be where the Dockerfile exists, and should be called srcds-cache.

# Build custom image
docker build -t l4d2 github.com/jackzmc/docker-l4d2-server

You can use steamcmd to download to srcds-cache with this command: steamcmd.sh +login aonymous +force_install_dir /path/to/dockerfile/srcds-cache +app_update 222860 +quit

docker-l4d2-server's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

pl77

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.