You've already forked docker-steamcmd
Dramatically reduced steps, pre-adding expected game folder, overall cleanup, etc.
This commit is contained in:
56
Dockerfile
56
Dockerfile
@@ -1,30 +1,30 @@
|
|||||||
FROM ubuntu:18.04
|
FROM ubuntu:18.04
|
||||||
|
|
||||||
LABEL Name=docker-steamcmd Version=1.0.0 Maintainer="Dave Jansen - Pretty Basic"
|
LABEL Name=docker-steamcmd Version=1.5.0 Maintainer="Dave Jansen - Pretty Basic"
|
||||||
|
|
||||||
## Ports
|
## Defaults
|
||||||
# Query Port cannot be between 27020 and 27050 due to Steam using those ports.
|
# Note: Query Port cannot be between 27020 and 27050 due to Steam using those ports.
|
||||||
ENV PORT_STEAM=27015
|
ENV \
|
||||||
|
PORT_STEAM=27015 \
|
||||||
## Other Settings
|
STEAMCMD_URL="https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" \
|
||||||
ENV STEAMCMD_URL="https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz"
|
USER_STEAM_ID=1000 \
|
||||||
ENV USER_STEAM_ID=1000
|
DIR_STEAMCMD=/opt/steamcmd \
|
||||||
ENV DIR_STEAMCMD=/opt/steamcmd
|
DIR_GAME=/opt/game \
|
||||||
|
DIR_USER=/opt/user \
|
||||||
# For debugging purposes only
|
DIR_APP=/opt/app
|
||||||
ENV DEBUGGER=
|
|
||||||
|
|
||||||
# Start by updating and installing the required packages
|
# Start by updating and installing the required packages
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
apt-get -y update; \
|
apt-get -y update; \
|
||||||
apt-get -y upgrade; \
|
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
|
# Create a user and usergroup for Steam, and adjust open file limitations.
|
||||||
RUN ulimit -n 100000;
|
# This is required for certain games, so let's set it by default
|
||||||
|
RUN \
|
||||||
# Create a user and usergroup for Steam
|
ulimit -n 100000; \
|
||||||
RUN set -ex; \
|
set -ex; \
|
||||||
addgroup \
|
addgroup \
|
||||||
-gid ${USER_STEAM_ID} \
|
-gid ${USER_STEAM_ID} \
|
||||||
steam; \
|
steam; \
|
||||||
@@ -34,22 +34,18 @@ RUN set -ex; \
|
|||||||
--gecos "" \
|
--gecos "" \
|
||||||
--gid ${USER_STEAM_ID} \
|
--gid ${USER_STEAM_ID} \
|
||||||
--uid ${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
|
# Make sure everything is run as the Steam user from the steam dir
|
||||||
RUN mkdir -p $DIR_STEAMCMD
|
|
||||||
RUN chown steam:steam $DIR_STEAMCMD
|
|
||||||
|
|
||||||
WORKDIR $DIR_STEAMCMD
|
|
||||||
|
|
||||||
# Make sure everything is run as the Steam user
|
|
||||||
USER steam
|
USER steam
|
||||||
|
WORKDIR ${DIR_STEAMCMD}
|
||||||
# Download & unpack SteamCMD
|
|
||||||
RUN curl -sqL ${STEAMCMD_URL} | tar zxfv -
|
|
||||||
|
|
||||||
# Announce the default Steam ports
|
# Announce the default Steam ports
|
||||||
# Note: You should open game-specific ports, too.
|
# Note: You should open game-specific port too.
|
||||||
EXPOSE ${PORT_STEAM}/udp
|
EXPOSE ${PORT_STEAM}/udp
|
||||||
|
|
||||||
# Optional: Initial run with anonymous login
|
# Optional: Initial run with anonymous login
|
||||||
|
|||||||
Reference in New Issue
Block a user