Skip to content

Commit

Permalink
dockerfile installs and preps 1.61
Browse files Browse the repository at this point in the history
  • Loading branch information
insanity54 committed Oct 8, 2014
1 parent 960956e commit 6b2548f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
assets/*.run
assets/*.tar.gz
assets/bf1942
bf1942
17 changes: 11 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,25 @@ FROM ubuntu:14.04

MAINTAINER Chris Grimmett <[email protected]>

# open ports for BF server
EXPOSE 14567/udp # game traffic
EXPOSE 3117/udp # server browser client request (LAN)
EXPOSE 22000/udp # server browser response (LAN)

# add server assets to container
ADD ./assets /srv/assets

# satisfy some deps
RUN apt-get update && apt-get -y install wget expect
# satisfy setup script and bf1942 dependencies
RUN apt-get update && \
apt-get -y install wget expect libc6-i386 lib32ncurses5 libc6-dev-i386

# setup battlefield server package
# * downloads needed bf server files
# * extracts 1.6 files
# * patches to 1.61
RUN bash -x /srv/assets/setup.sh

# open ports for BF server
EXPOSE 14567

# run battlefield server
# RUN bash -x /srv/assets/bf1942/start.sh #dont do this here
# set default command for running this container (run bf server)
CMD /srv/start

2 changes: 1 addition & 1 deletion assets/extract
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/expect

spawn "/home/chris/scripts/bff/assets/bf1942_lnxded-1.6-rc2.run" --keep
spawn "/srv/assets/bf1942_lnxded-1.6-rc2.run" --keep --target ../bf1942

expect {
timeout { send_user "\ntimeout in extraction\n"; exit 1 }
Expand Down
4 changes: 3 additions & 1 deletion assets/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,7 @@ fi
./extract

# patch to 1.61
tar -xvf ./bf1942-update-1.61.tar.gz
tar -xvf ./bf1942-update-1.61.tar.gz -C /srv

# create a link to the start script
ln -s /srv/assets/start.sh /srv/start
4 changes: 4 additions & 0 deletions assets/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@

# send heartbeat to the new master server (workaround for gamespy shutdown)
echo '109.71.69.254 master.gamespy.com' >> /etc/hosts

# start the server
cd /srv/bf1942
/srv/bf1942/start.sh

0 comments on commit 6b2548f

Please sign in to comment.