-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
79 lines (59 loc) · 2.51 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
##############################################################################
# Dockerfile to build ArmA 3 container images
# Based on ubuntu:18.04
##############################################################################
FROM ubuntu:18.04
LABEL maintainer "play-net.org <docker@play-net.org>"
LABEL author "Finch"
ARG STEAM_USERNAME
ARG STEAM_PASSWORD
ENV ARMA_INST /opt/arma
ENV STEAM_INST /opt/steam
ENV SYSTEM_USER arma
ENV SYSTEM_GROUP arma
ENV SYSTEM_HOME /home/arma
ENV APPID 233780
RUN set -x \
&& apt-get update --yes && apt-get upgrade --yes \
&& apt-get install --yes lib32stdc++6 lib32gcc1 wget \
&& rm -rf /var/cache/apk/*
RUN set -x \
&& mkdir -p ${ARMA_INST}/config \
&& mkdir -p ${STEAM_INST}
RUN set -x \
&& mkdir -p ${SYSTEM_HOME} \
&& addgroup --system ${SYSTEM_GROUP} \
&& adduser --system --disabled-login --disabled-password --ingroup ${SYSTEM_GROUP} --home ${SYSTEM_HOME} --shell /bin/sh ${SYSTEM_USER} \
&& chown -R ${SYSTEM_USER}:${SYSTEM_GROUP} ${SYSTEM_HOME}
RUN set -x \
&& wget -nv -O /tmp/steamcmd.tar.gz https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz \
&& tar xfz /tmp/steamcmd.tar.gz --strip-components=1 -C ${STEAM_INST} \
&& rm /tmp/steamcmd.tar.gz \
&& chown -R ${SYSTEM_USER}:${SYSTEM_GROUP} ${STEAM_INST} \
&& mkdir -p ${SYSTEM_HOME}/".local/share/Arma 3" \
&& mkdir -p ${SYSTEM_HOME}/".local/share/Arma 3 - Other Profiles" \
&& chown -R ${SYSTEM_USER}:${SYSTEM_GROUP} ${SYSTEM_HOME}/".local/share/Arma 3" \
&& chown -R ${SYSTEM_USER}:${SYSTEM_GROUP} ${SYSTEM_HOME}/".local/share/Arma 3 - Other Profiles"
RUN set -x \
&& ${STEAM_INST}/steamcmd +quit; exit 0
RUN set -x \
&& /opt/steamcmd.sh +login ${STEAM_USERNAME} ${STEAM_PASSWORD} +force_install_dir ${ARMA_INST} +app_update ${APPID} +quit; exit 0
# RUN ln -s ${ARMA_INST}/mpmissions ${ARMA_INST}/MPMissions
ADD files/service /usr/local/bin/service
ADD files/entrypoint /usr/local/bin/entrypoint
RUN set -x \
&& chown -R ${SYSTEM_USER}:${SYSTEM_GROUP} /usr/local/bin/service \
&& chown -R ${SYSTEM_USER}:${SYSTEM_GROUP} /usr/local/bin/entrypoint \
&& chown -R ${SYSTEM_USER}:${SYSTEM_GROUP} /opt/arma \
&& chmod +x /usr/local/bin/service \
&& chmod +x /usr/local/bin/entrypoint
EXPOSE 2302 2303 2304
USER ${SYSTEM_USER}
COPY files/server.cfg ${ARMA_INST}/config/server.cfg.template
VOLUME ${ARMA_INST}/mpmissions
VOLUME ${ARMA_INST}/mods
VOLUME ${ARMA_INST}/keys
VOLUME ${ARMA_INST}/config
WORKDIR ${ARMA_INST}
ENTRYPOINT ["/usr/local/bin/entrypoint"]
CMD ["/usr/local/bin/service"]