-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.cs2
85 lines (65 loc) · 2.52 KB
/
Dockerfile.cs2
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
############################################################
# Dockerfile that contains SteamCMD
############################################################
FROM ubuntu as build_stage
# docker build --file Dockerfile.cs2 --tag cs2_server:0.2.8 .
# docker run -it cs2_server:0.2.8 bash
# docker run -it --network host --volume ${HOME}/Downloads/cs2_app:/data/steam/csgo_app --volume `pwd`/csgo_scripts:/data/steam/csgo_git_repo/csgo_scripts cs2_server:0.2.8 bash
# su - steam
# ~/csgo_git_repo/csgo_scripts/run_cs2_server.sh
# cd ~/csgo_app
# export LD_LIBRARY_PATH=/home/steam/steamcmd/linux32
# time steamcmd +force_install_dir ~/csgo_app/ +login STEAM_LOGIN STEAM_PASSWORD +app_update 730 validate +quit
# ~/csgo_git_repo/csgo_scripts/run_cs2_server.sh
#
# export LD_LIBRARY_PATH=/usr/lib/games/linux64
# /data/steam/csgo_app/game/bin/linuxsteamrt64/cs2 -dedicated +map de_dust2
ARG PUID=1000
ENV USER steam
ENV HOMEDIR "/data/${USER}"
ENV STEAMCMDDIR "${HOMEDIR}/steamcmd"
RUN apt update -y && apt upgrade -y
RUN mkdir /data
RUN useradd --home-dir "${HOMEDIR}" --create-home -u "${PUID}" --shell /usr/bin/bash ${USER}
# Insert Steam prompt answers
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN echo steam steam/question select "I AGREE" | debconf-set-selections \
&& echo steam steam/license note '' | debconf-set-selections
# Update the repository and install SteamCMD
ARG DEBIAN_FRONTEND=noninteractive
RUN dpkg --add-architecture i386 \
&& apt-get update -y \
&& apt-get install -y --no-install-recommends --no-install-suggests \
ca-certificates\
curl\
file\
htop\
iproute2\
less\
libxcb1\
locales\
steamcmd\
strace\
vim
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
&& dpkg-reconfigure --frontend=noninteractive locales
RUN mkdir ${HOMEDIR}/.steam
RUN chown ${USER}:${USER} ${HOMEDIR}/.steam
RUN mkdir ${HOMEDIR}/csgo_git_repo
RUN chown ${USER}:${USER} ${HOMEDIR}/csgo_git_repo
ADD csgo_scripts/run_cs2_server.sh ${HOMEDIR}/
RUN chown ${USER}:${USER} ${HOMEDIR}/run_cs2_server.sh
RUN apt update && apt upgrade -y
# Clean up
RUN apt-get remove --purge --auto-remove -y \
&& rm -rf /var/lib/apt/lists/*
FROM build_stage AS ubuntu-root
# Allow the steam user to update the steam app?
RUN chgrp steam /usr/lib/games && \
chmod g+w /usr/lib/games
WORKDIR ${HOMEDIR}
#FROM bullseye-root AS bullseye
# Switch to user
USER ${USER}
RUN echo "0.2.8" >> docker_image_version
RUN export LD_LIBRARY_PATH=/home/steam/steamcmd/linux32 && /usr/games/steamcmd +quit