diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3c9cd6a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,42 @@ +# These don't have to be replaced unless you, for example, +# want to refer to a locally built version +ARG STEAM_IMG=docker-steamcmd +ARG STEAMCMD_TAG=latest + +FROM ${STEAM_IMG}:${STEAMCMD_TAG} + +# E.g. To install Counter Strike Source, run: +# docker build --build-arg GAME_ID=232330 --rm -t game-cssource:latest . +ARG GAME_ID + +# Preserve the ID specified for future reference +ENV INSTALLED_GAME_ID=${GAME_ID} + +USER steam + +VOLUME [ ${DIR_GAME} ] + +# Installs the game specified in GAME_ID +# Note: The game is installed in the DIR_GAME directory +# prepared by docker-steamcmd. + +WORKDIR ${DIR_STEAMCMD} + +# TODO: Check if it's worth using proper steam login +# not sure if Steam has rate limiting on anonymous accounts +RUN ./steamcmd.sh \ + +@NoPromptForPassword 1 \ + +login anonymous \ + +force_install_dir ${DIR_GAME} \ + +app_update ${GAME_ID} validate \ + +quit + +CMD [ "./steamcmd.sh" ] + +# CMD [ "./steamcmd.sh", \ +# "+@NoPromptForPassword 1", \ +# "+login anonymous", \ +# "+force_install_dir ${DIR_GAME}", \ +# "+app_update ${GAME_ID} validate", \ +# "+quit" \ +# ] \ No newline at end of file diff --git a/README.md b/README.md index 8ae44b6..f2667d5 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ -# docker-steamcmd-install -Barebones SteamCMD game installation using my docker-steamcmd image. +# SteamCMD with assumed game installation for Docker + +Uses my [docker-steamcmd](https://github.com/hellodeibu/docker-steamcmd) image. This barebones image is handy if you want to immediately install a specific game using SteamCMD. Simply provide the STEAM_APP_ID environment variable and that's it. + +Note: You probable want to use this image as a build stage for your game-specific image, so that you can do additional setup and configuration on top of a downloaded and ready to go game setup.