remove unused maps

This commit is contained in:
Robin Appelman 2016-01-16 15:50:34 +01:00
commit bf9d31e1f9
3 changed files with 19 additions and 3 deletions

View file

@ -20,7 +20,8 @@ RUN wget -O - http://media.steampowered.com/client/steamcmd_linux.tar.gz | tar -
ADD ./tf2_ds.txt $SERVER/tf2_ds.txt ADD ./tf2_ds.txt $SERVER/tf2_ds.txt
ADD ./update.sh $SERVER/update.sh ADD ./update.sh $SERVER/update.sh
ADD ./tf.sh $SERVER/tf.sh ADD ./tf.sh $SERVER/tf.sh
RUN $SERVER/update.sh ADD ./clean.sh $SERVER/clean.sh
RUN $SERVER/update.sh && $SERVER/clean.sh
EXPOSE 27015/udp EXPOSE 27015/udp

View file

@ -6,9 +6,13 @@ Basic Team Fortress 2 server
docker pull spiretf/docker-tf2-server docker pull spiretf/docker-tf2-server
``` ```
### Maps ###
In order to reduce the image size this image has most of the maps removed, you'll probably want to add aditional maps to a derived image, install [mapdownloader](https://github.com/spiretf/mapdownloader) or use [spiretf/docker-comp-server](https://hub.docker.com/r/spiretf/docker-comp-server) (comes with mapdownloader) instead.
### Details: ### Details:
By default image is build with enabled autoupdate feature (take a look at `tf.sh` file). By default image is build with enabled autoupdate feature (take a look at `tf.sh` file).
You can create new Dockerfile based on that image (FROM tf2) and customize it with plugins, configs, CMD and ENTRYPOINT instructions. You can create new Dockerfile based on that image (FROM spiretf/docker-tf2-server) and customize it with plugins, configs, CMD and ENTRYPOINT instructions.
```shell ```shell
@ -16,7 +20,7 @@ You can create new Dockerfile based on that image (FROM tf2) and customize it wi
docker run -d -p 27015:27015/udp spiretf/docker-tf2-server docker run -d -p 27015:27015/udp spiretf/docker-tf2-server
# Run image with custom options # Run image with custom options
docker run -d -p 27015:27015/udp spiretf/docker-tf2-server +sv_pure 2 +map ctf_2fort.bsp +maxplayers 32 docker run -d -p 27015:27015/udp spiretf/docker-tf2-server +sv_pure 2 +map pl_badwater.bsp +maxplayers 32
# Run image with custom config # Run image with custom config
docker run -d -p 27015:27015/udp -v ~/server.cfg:/home/tf2/hlserver/tf2/tf/cfg/server.cfg:ro spiretf/docker-tf2-server docker run -d -p 27015:27015/udp -v ~/server.cfg:/home/tf2/hlserver/tf2/tf/cfg/server.cfg:ro spiretf/docker-tf2-server

11
clean.sh Executable file
View file

@ -0,0 +1,11 @@
#! /bin/bash
cd $SERVER/tf2/tf/maps
MAPS_KEEP=("cp_badlands.bsp" "cp_gravelpit.bsp" "cp_granary.bsp" "cp_gullywash_final1.bsp" "cp_process_final.bsp" "cp_snakewater_final1.bsp" "cp_steel.bsp" "koth_lakeside_final.bsp" "pl_badwater.bsp" "pl_borneo.bsp" "pl_upward.bsp")
MAPS_ALL=( $(find -type f -name "*.bsp" -printf "%f\n") )
# MAPS_DELETE=($(diff MAPS_ALL[@] MAPS_KEEP[@]))
MAPS_DELETE=$(echo ${MAPS_ALL[@]} ${MAPS_KEEP[@]} | tr ' ' '\n' | sort | uniq -u)
rm ${MAPS_DELETE[@]}