You've already forked docker-steamcmd
Compare commits
5 Commits
v1.0-alpha
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 20dc51b631 | |||
| 200aba28d7 | |||
| 05574415db | |||
| 72c25eec73 | |||
| 656c4dab07 |
61
Dockerfile
61
Dockerfile
@@ -2,24 +2,29 @@ FROM ubuntu:18.04
|
||||
|
||||
LABEL Name=docker-steamcmd Version=1.0.0 Maintainer="Dave Jansen - Pretty Basic"
|
||||
|
||||
ENV PORT_STEAM=27015
|
||||
ENV STEAMCMD_URL="https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz"
|
||||
ENV USER_STEAM_ID=1000
|
||||
## Defaults
|
||||
# Note: Query Port cannot be between 27020 and 27050 due to Steam using those ports.
|
||||
ENV \
|
||||
PORT_STEAM=27015 \
|
||||
STEAMCMD_URL="https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" \
|
||||
USER_STEAM_ID=1000 \
|
||||
DIR_STEAMCMD=/opt/steamcmd \
|
||||
DIR_GAME=/opt/game \
|
||||
DIR_USER=/opt/user \
|
||||
DIR_APP=/opt/app
|
||||
|
||||
# For debugging purposes only
|
||||
ENV DEBUGGER=
|
||||
|
||||
# Start by updating and installing the required packages
|
||||
# Start by updating and installing required packages
|
||||
RUN set -ex; \
|
||||
apt-get -y update; \
|
||||
apt-get -y upgrade; \
|
||||
apt-get install -y curl lib32gcc1;
|
||||
apt-get install -y curl lib32gcc1; \
|
||||
rm -rf /var/lib/{apt,dpkg,cache,log}/;
|
||||
|
||||
# Adjust open file limitations -- This is required for certain games, so let's set it by default
|
||||
RUN ulimit -n 100000;
|
||||
|
||||
# Create a user and usergroup for Steam
|
||||
RUN set -ex; \
|
||||
# Create a user and usergroup for Steam, and adjust open file limitations.
|
||||
# This is required for certain games, so let's set it by default
|
||||
RUN \
|
||||
ulimit -n 100000; \
|
||||
set -ex; \
|
||||
addgroup \
|
||||
-gid ${USER_STEAM_ID} \
|
||||
steam; \
|
||||
@@ -29,26 +34,30 @@ RUN set -ex; \
|
||||
--gecos "" \
|
||||
--gid ${USER_STEAM_ID} \
|
||||
--uid ${USER_STEAM_ID} \
|
||||
steam;
|
||||
steam; \
|
||||
mkdir -p ${DIR_STEAMCMD} ${DIR_GAME} ${DIR_USER} ${DIR_APP}; \
|
||||
cd $DIR_STEAMCMD; \
|
||||
curl -sqL ${STEAMCMD_URL} | tar zxfv -; \
|
||||
chown -R steam:steam ${DIR_STEAMCMD} ${DIR_GAME} ${DIR_USER} ${DIR_APP};
|
||||
|
||||
# Create the directory SteamCMD will live in, and set its ownership
|
||||
RUN mkdir -p /opt/steamcmd
|
||||
RUN chown steam:steam /opt/steamcmd
|
||||
# Adjust open file limitations
|
||||
# TODO: Check if we need all three methods or if one of them is enough.
|
||||
# RUN set -ex; \
|
||||
# ulimit -n 100000; \
|
||||
# sysctl -w fs.file-max=100000; \
|
||||
# echo "session required pam_limits.so" >> /etc/pam.d/common-session;
|
||||
|
||||
WORKDIR /opt/steamcmd
|
||||
|
||||
# Make sure everything is run as the Steam user
|
||||
# Make sure everything is run as the Steam user from the steam dir
|
||||
USER steam
|
||||
|
||||
# Download & unpack SteamCMD
|
||||
RUN curl -sqL ${STEAMCMD_URL} | tar zxfv -
|
||||
WORKDIR ${DIR_STEAMCMD}
|
||||
|
||||
# Announce the default Steam ports
|
||||
# Note: You should open game-specific ports, too.
|
||||
EXPOSE ${PORT_STEAM}/tcp ${PORT_STEAM}/udp
|
||||
# Note: You should open game-specific port too.
|
||||
EXPOSE ${PORT_STEAM}/udp
|
||||
|
||||
# Optional: Initial run with anonymous login
|
||||
# This should stay disabled when using Docker Hub to auto-build, for example
|
||||
# Run SteamCMD to finalize installation — Disable this if you run this on something like Docker Hub as it will fail
|
||||
# RUN [ "./steamcmd.sh", "+@NoPromptForPassword 1", "+login anonymous", "+quit" ]
|
||||
|
||||
ENTRYPOINT [ "/opt/steamcmd/steamcmd.sh" ]
|
||||
ENTRYPOINT [ "./steamcmd.sh" ]
|
||||
|
||||
23
README.md
23
README.md
@@ -1,3 +1,24 @@
|
||||
# SteamCMD for Docker
|
||||
|
||||
Based on the Ubuntu 18.04 image. This is a barebones image designed to be used as a starting point for your own image.
|
||||
Based on the Ubuntu 18.04 image. This is a barebones image designed to be used as a starting point for your own game-specific image.
|
||||
|
||||
## v1.0
|
||||
|
||||
For the first "real" version I tried to greatly reduce the amount of steps required to build the image, and I made its purpose of being used as a pre-build step rather than the main image to be used more obvious. While you can still certainly use this image directly, you'll more likely want to use this as one of your build steps instead.
|
||||
|
||||
## Directories
|
||||
|
||||
The image prepares a few folders that I recommend you use in your setup where appropriate. These are:
|
||||
|
||||
- `/opt/steam` contains the actual steamcmd setup.
|
||||
- `/opt/game` is prepared and owned by the same `steam` user and is recommended to be used to `force-install_dir` your game to
|
||||
- `/opt/app` if you need to run anything else alongside or as a pre- or post-install step, you might want to use this directory. It is also owned by the same `steam` user.
|
||||
|
||||
## A note on the actual SteamCMD installation
|
||||
|
||||
While this image prepares everything you need, by default it does not do a first-run that pulls in the latest Steam updates and what-not. This is done as this run would actually fail if you happen to run this on Docker Hub for example, but if you locally build your image and want to have Steam 100% ready to go, it would be good to uncomment-out that line and have it do its first run. However, as this will happen automatically when installing a game too, you might as-well just do it then.
|
||||
|
||||
```Dockerfile
|
||||
# Run SteamCMD to finalize installation — Disable this if you run this on something like Docker Hub as it will fail
|
||||
RUN [ "./steamcmd.sh", "+@NoPromptForPassword 1", "+login anonymous", "+quit" ]
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user