forked from MitchTalmadge/AMP-dockerized
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
147 lines (131 loc) · 4.03 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
FROM ubuntu:18.04
ENV UID=1000
ENV GID=1000
ENV TZ=Etc/UTC
ENV PORT=8080
ENV USERNAME=admin
ENV PASSWORD=password
ENV LICENCE=notset
ENV MODULE=ADS
ARG DEBIAN_FRONTEND=noninteractive
# Initialize
RUN apt-get update && \
apt-get install -y --no-install-recommends \
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
# Add Mono apt source
RUN apt-get update && \
apt-get install -y --no-install-recommends \
apt-transport-https \
dirmngr \
software-properties-common \
gnupg \
ca-certificates && \
apt-get -y clean && \
apt-get -y autoremove --purge && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \
echo "deb https://download.mono-project.com/repo/debian stable-stretch main" | tee /etc/apt/sources.list.d/mono-official-stable.list
# Install Mono Certificates
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates-mono && \
apt-get -y clean && \
apt-get -y autoremove --purge && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
RUN wget -O /tmp/cacert.pem https://curl.haxx.se/ca/cacert.pem && \
cert-sync /tmp/cacert.pem
# Install AMP dependencies
RUN ls -al /usr/local/bin/
RUN apt-get update && \
apt-get install -y \
# --------------------
# Dependencies for AMP:
tmux \
git \
socat \
unzip \
iputils-ping \
procps \
# --------------------
# Dependencies for Minecraft:
openjdk-11-jre-headless \
openjdk-8-jre-headless \
# --------------------
# Dependencies for srcds (TF2, GMod, ...)
libcurl4 \
lib32gcc1 \
lib32stdc++6 \
lib32tinfo5 \
# --------------------
# Dependencies for Factorio:
xz-utils \
# --------------------
&& \
apt-get -y clean && \
apt-get -y autoremove --purge && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
# 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
apt-key adv --fetch-keys http://repo.cubecoders.com/archive.key && \
apt-add-repository "deb http://repo.cubecoders.com/ debian/" && \
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/*
# Get the latest AMP Core to pre-cache upgrades.
RUN wget https://cubecoders.com/AMPVersions.json -O /tmp/AMPVersions.json && \
wget https://cubecoders.com/Downloads/AMP_Latest.zip -O /opt/AMPCache-$(cat /tmp/AMPVersions.json | jq -r '.AMPCore' | sed -e 's/\.//g').zip
# Set up environment
COPY entrypoint /opt/entrypoint
RUN chmod -R +x /opt/entrypoint
VOLUME ["/home/amp/.ampdata"]
ENTRYPOINT ["/opt/entrypoint/main.sh"]