-
Notifications
You must be signed in to change notification settings - Fork 22
/
Dockerfile
196 lines (177 loc) · 5.43 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
FROM debian:12-slim
ARG TARGETPLATFORM # Set by Docker, see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
ENV UID=1000
ENV GID=1000
ENV TZ=Etc/UTC
ENV PORT=8080
ENV USERNAME=admin
ENV PASSWORD=password
ENV IPBINDING=0.0.0.0
ENV AMP_AUTO_UPDATE=true
ENV AMP_LICENCE=notset
ENV AMP_MODULE=ADS
ENV AMP_RELEASE_STREAM=Mainline
ENV AMP_SUPPORT_LEVEL=UNSUPPORTED
ENV AMP_SUPPORT_TOKEN=AST0/MTAD
ENV AMP_SUPPORT_TAGS="nosupport docker community unofficial unraid"
ENV AMP_SUPPORT_URL="https://github.com/MitchTalmadge/AMP-dockerized/"
ENV LD_LIBRARY_PATH="./:/opt/cubecoders/amp/:/AMP/"
ARG DEBIAN_FRONTEND=noninteractive
# Initialize
RUN apt-get update && \
apt-get install -y --no-install-recommends \
apt-transport-https \
jq \
sed \
tzdata \
wget && \
apt-get -y clean && \
apt-get -y autoremove --purge && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
# Configure Locales
RUN apt-get update && \
apt-get install -y --no-install-recommends locales && \
apt-get -y clean && \
apt-get -y autoremove --purge && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
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 && \
update-locale LANG=en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# Install Mono
RUN apt-get update && \
apt-get install -y \
dirmngr \
ca-certificates \
gnupg && \
gpg --homedir /tmp --no-default-keyring --keyring /usr/share/keyrings/mono-official-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \
echo "deb [signed-by=/usr/share/keyrings/mono-official-archive-keyring.gpg] https://download.mono-project.com/repo/debian stable-buster main" | tee /etc/apt/sources.list.d/mono-official-stable.list && \
apt-get update && \
apt-get install -y mono-devel && \
apt-get -y clean && \
apt-get -y autoremove --purge && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
# Declare and install AMP dependencies
# AMP core dependencies
ARG AMPDEPS="\
bzip2 \
coreutils \
curl \
gdb \
git \
git-lfs \
gnupg \
iputils-ping \
libc++-dev \
libc6 \
libatomic1 \
libgdiplus \
liblua5.3-0 \
libpulse-dev \
libsqlite3-0 \
libzstd1 \
locales \
numactl \
procps \
software-properties-common \
socat \
tmux \
unzip \
xz-utils"
# srcds (TF2, GMod, ...) dependencies
ARG SRCDSDEPS="\
lib32gcc-s1 \
lib32stdc++6 \
lib32z1 \
libbz2-1.0:i386 \
libcurl3-gnutls:i386 \
libcurl4 \
libncurses5:i386 \
libsdl2-2.0-0 \
libsdl2-2.0-0:i386 \
libtinfo5:i386"
# Needed for games that require Wine and Xvfb
ARG WINEXVFB="\
fonts-wine \
libwine \
libwine:i386 \
python3 \
python3-venv \
cabextract \
wine \
wine32 \
wine64 \
wine-binfmt \
winbind \
xauth \
xvfb"
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
dpkg --add-architecture aarch64 && \
apt-get update && \
apt-get install -y \
$AMPDEPS; \
else \
dpkg --add-architecture i386 && \
apt-get update && \
apt-get install -y \
$AMPDEPS \
$SRCDSDEPS \
$WINEXVFB; \
fi && \
apt-get -y clean && \
apt-get -y autoremove --purge && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
# Install Adoptium JDK
RUN wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | tee /etc/apt/keyrings/adoptium.asc && \
echo "deb [signed-by=/etc/apt/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list && \
apt-get update && \
apt-get install -y temurin-8-jdk temurin-11-jdk temurin-17-jdk temurin-21-jdk && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Manually install ampinstmgr by extracting it from the deb package.
# Docker doesn't have systemctl and other things that AMP's deb postinst expects,
# so we can't use apt to install ampinstmgr.
RUN apt-get update && \
apt-get install -y --no-install-recommends \
software-properties-common \
dirmngr \
apt-transport-https
# Add CubeCoders repository and key
RUN wget -qO - http://repo.cubecoders.com/archive.key | gpg --dearmor > /etc/apt/trusted.gpg.d/cubecoders-archive-keyring.gpg && \
if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
apt-add-repository "deb http://repo.cubecoders.com/aarch64 debian/"; \
else \
apt-add-repository "deb http://repo.cubecoders.com/ debian/"; \
fi && \
apt-get update && \
# Just download (don't actually install) ampinstmgr
apt-get install -y --no-install-recommends --download-only ampinstmgr && \
# Extract ampinstmgr from downloaded package
mkdir -p /tmp/ampinstmgr && \
dpkg-deb -x /var/cache/apt/archives/ampinstmgr_*.deb /tmp/ampinstmgr && \
mv /tmp/ampinstmgr/opt/cubecoders/amp/ampinstmgr /usr/local/bin/ampinstmgr && \
apt-get -y clean && \
apt-get -y autoremove --purge && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
# Set up environment
COPY entrypoint /opt/entrypoint
RUN chmod -R +x /opt/entrypoint
VOLUME ["/home/amp/.ampdata"]
ENTRYPOINT ["/opt/entrypoint/main.sh"]