-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
56 lines (39 loc) · 1.78 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
FROM scottyhardy/docker-wine
ARG USERNAME=anonymous
ARG PASSWORD=
ARG GUARDCODE=
ARG APPID=
ARG RUNCMD=
# Enable console (headless mode)
ARG HEADLESS=yes
# Enable remote desktop access.
ARG RDP_SERVER=no
ARG RDP_PASSWD=games
ENV RDP_SERVER "$RDP_SERVER"
# Suppress non-blocking warnings.
ENV DBUS_FATAL_WARNINGS 0
ENV WINEDEBUG -all
ENV WINEPREFIX /usr/games/.wine
ENV PROGRAM_FILES "$WINEPREFIX"/drive_c/Program\ Files\ \(x86\)
RUN mkdir -p "$PROGRAM_FILES"
COPY files /usr/games/files
RUN usermod --shell /bin/bash games && chown -R games:games /usr/games
USER games
WORKDIR /usr/games
# Install the Steam application.
RUN wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip && unzip steamcmd.zip -d "$PROGRAM_FILES"/Steam && rm steamcmd.zip
RUN wine "$PROGRAM_FILES"/Steam/steamcmd.exe +login "$USERNAME" "$PASSWORD" "$GUARDCODE" +app_update "$APPID" +quit 2> /dev/null ; exit 0
# Install Steam app dependencies.
RUN ln -s "$PROGRAM_FILES"/Steam /usr/games/Steam && mkdir -p /usr/games/Steam/steamapps/common && \
find /usr/games/Steam/steamapps/common -maxdepth 0 -not -name "Steamworks Shared" | xargs -I{} cp -rf files/* {} && rm -rf files
USER root
COPY init.d/game-server /etc/init.d/game-server
# Install LSB init and RC scripts.
RUN update-rc.d game-server defaults && echo "HEADLESS=$HEADLESS\nRUNCMD=\$(cat <<EOL\n$RUNCMD\nEOL\n)" > .game-server
# Configure RDP dependencies.
RUN if [ "$RDP_SERVER" = yes ]; then usermod --password "$(openssl passwd -1 -salt $(openssl rand -base64 6) $RDP_PASSWD)" --shell /bin/bash games; fi
COPY config /usr/games/.config
RUN sed -i 's/allow_channels=true/allow_channels=false/g' /etc/xrdp/xrdp.ini
RUN mv /usr/games/.config/user-dirs.conf /etc/xdg/user-dirs.defaults
COPY launch.sh /usr/games/launch.sh
ENTRYPOINT /usr/games/launch.sh