crosbymichael / steamcmd-docker

Steam cmd for linux servers
15 stars 3 forks source link

howto reuse as a base image #1

Open airtonix opened 9 years ago

airtonix commented 9 years ago

New to docker, but I assumed I could simply create a Dockerfile that uses this steamcmd image as a base.

Instead I get errors about not being able to write to directories I create in my dockerfile.

FROM crosbymichael/steamcmd

ENV APP_ROOT /opt/arma3server

VOLUME ${APP_ROOT}/profiles
VOLUME ${APP_ROOT}/mods
VOLUME ${APP_ROOT}/client
VOLUME ${APP_ROOT}/public
VOLUME ${APP_ROOT}/test
VOLUME ${APP_ROOT}/battleeye

RUN ["mkdir", "${APP_ROOT}/server", "-p"]
RUN ["mkdir", "${APP_ROOT}/profiles", "-p"]
RUN ["mkdir", "${APP_ROOT}/mods", "-p"]
RUN ["mkdir", "${APP_ROOT}/client", "-p"]
RUN ["mkdir", "${APP_ROOT}/public", "-p"]
RUN ["mkdir", "${APP_ROOT}/test", "-p"]
RUN ["mkdir", "${APP_ROOT}/battleeye", "-p"]

ADD server.cfg ${APP_ROOT}/server/server.cfg
ADD world.cfg ${APP_ROOT}/server/world.cfg
ADD profile ${APP_ROOT}/server.Arma3Profile

WORKDIR ${APP_ROOT}
USER arma3server
CMD ./server/arma3server -netlog -config=world.cfg -cfg=server.cfg -port=${APP_PORT} -profiles=${APP_ROOT}/profiles -name=server.Arma3Profile -BEpath=${APP_ROOT}/battleeye
crosbymichael commented 9 years ago

For arma3 you would do this:

Dockerfile

FROM crosbymichael/steamcmd
USER root
RUN apt-get update && apt-get install -y lib32stdc++6 lib32z1 lib32z1-dev
USER daemon

And in the same dir as your dockerfile you need an install.txt like this for arma

@ShutdownOnFailedCommand 1
@NoPromptForPassword 1
login your_username your_pass_word
force_install_dir /home/daemon/steamcmd/arma3
app_update 233780 validate
quit
crosbymichael commented 9 years ago

After you have a base arma image if you wanted to get a wasteland server you can checkout the repo here and the dockerfile

https://github.com/crosbymichael/Release_Files

FROM your_base_arma3_image

WORKDIR /home/daemon/steamcmd/arma3
RUN curl -SsL -o mpmissions/A3Wasteland_v1.0.Altis.pbo https://github.com/A3Wasteland/Release_Files/raw/master/A3Wasteland_v1.0.Altis.pbo

ENTRYPOINT ["./arma3server", "-cfg=wasteland/basic", "-config=wasteland/config", "-profiles=wasteland"]
divmgl commented 8 years ago

This is some seriously impressive shit. I'm about to make an awesome low latency CSGO server