diff --git a/Dockerfile b/Dockerfile index b58f518..e0d8f2d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,12 @@ ############################################################ # Dockerfile to build OpenTTD container images -# Based on debian:jessie +# Based on phusion:baseimage (from ubuntu) ############################################################ -# Set the base image to debian:jessie FROM phusion/baseimage -# File Author / Maintainer MAINTAINER Mats Bergmann -# Update the repository sources list -ENV DEBIAN_FRONTEND noninteractive -ENV DEBUG 0 -ENV loadgame false -ENV savename autosave/exit.sav - WORKDIR /tmp/ ADD . /tmp/ RUN /tmp/prepare.sh && \ @@ -23,7 +15,6 @@ RUN /tmp/prepare.sh && \ VOLUME /home/openttd/.openttd -# Expose the default ports EXPOSE 3979/tcp EXPOSE 3979/udp diff --git a/README.md b/README.md index 9ca13e9..df4ca2c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -These images have been built and tested on docker 1.6.2. Previous versions may not run as smooth. +These images have been built and tested on docker 1.7.1. Previous versions may not run as smooth. ## Usage ## @@ -12,13 +12,15 @@ with -P -Its set up to not load any games by default (new game) and it can be run without mounting a .openttd folder. however, if you want to load your savegames, this is required. +Its set up to not load any games by default (new game) and it can be run without mounting a .openttd folder. +However, if you want to load your savegames, mounting a .openttd folder is required. Set -e "loadgame=exit" -to enable loading of save/autosave/exit.sav. +to enable loading of save/autosave/exit.sav. +For Openttd to save on exit you need to set "autosave_on_exit = true" in your openttd.cfg file under the [gui] section. For other save games use @@ -30,7 +32,7 @@ To mount up your .openttd folder use For example to run server and load my savegame game.sav: - docker run -d --name openttd -p 3979:3979/tcp -p 3979:3979/udp -v /home/username/.openttd:/root/.openttd -e "loadgame=true" -e "savename=save/game.sav" bateau/openttd:latest + docker run -d --name openttd -p 3979:3979/tcp -p 3979:3979/udp -v /home/username/.openttd:/root/.openttd -e "loadgame=true" -e "savename=game.sav" bateau/openttd:latest ## Other tags ## * 1.5.1 diff --git a/buildconfig b/buildconfig index 0085fd0..a706f02 100755 --- a/buildconfig +++ b/buildconfig @@ -1,3 +1,7 @@ export LC_ALL=C export DEBIAN_FRONTEND=noninteractive +export DEBUG=0 +export loadgame=false +export savename=autosave/exit.sav + minimal_apt_get_install='apt-get install -y --no-install-recommends' diff --git a/cleanup.sh b/cleanup.sh index 53aa08f..0e5243f 100755 --- a/cleanup.sh +++ b/cleanup.sh @@ -4,7 +4,7 @@ set -x apt-get remove -y unzip wget apt-get autoremove -y -apt-get clean +apt-get autoclean -y rm -rf /tmp/* /var/tmp/* rm -rf /var/lib/apt/lists/* diff --git a/runit/control/t b/runit/control/t index a889e99..48d1fd0 100755 --- a/runit/control/t +++ b/runit/control/t @@ -12,7 +12,7 @@ fi if `kill -3 $PID`; then echo "Success!" - while `/bin/ps -axg | grep -v grep | grep /usr/games/openttd > /dev/null`; do echo "wait for openttd" sleep 1; done + while `/bin/ps -axg | grep -v grep | grep /usr/games/openttd > /dev/null`; do echo "wait for openttd" sleep 5; done exit 0 else echo "Fail! $?"