Skip to content

Commit

Permalink
small tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
bateau84 committed Sep 4, 2015
1 parent 74402f7 commit 6056bba
Showing 5 changed files with 13 additions and 16 deletions.
11 changes: 1 addition & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 <bateau@sea-shell.org>

# 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

10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions buildconfig
Original file line number Diff line number Diff line change
@@ -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'
2 changes: 1 addition & 1 deletion cleanup.sh
Original file line number Diff line number Diff line change
@@ -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/*
2 changes: 1 addition & 1 deletion runit/control/t
Original file line number Diff line number Diff line change
@@ -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! $?"

0 comments on commit 6056bba

Please sign in to comment.