-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
285 lines (234 loc) · 10.4 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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
FROM arm64v8/debian:bookworm-slim as box64_m1
ENV DEBIAN_FRONTEND noninteractive
# Set SHELL option explicitly
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008
RUN set -x \
# Install, update & upgrade packages
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
ca-certificates \
wget \
gnupg \
&& wget --progress=dot:giga https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list \
&& (wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg) \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
box64-m1
############################################################
FROM arm64v8/debian:bookworm-slim as box64_rpi5_4k
ENV DEBIAN_FRONTEND noninteractive
# Set SHELL option explicitly
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008
RUN set -x \
# Install, update & upgrade packages
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
ca-certificates \
wget \
gnupg \
&& wget --progress=dot:giga https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list \
&& (wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg) \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
box64-rpi5arm64
############################################################
FROM arm64v8/debian:bookworm-slim as box64_rpi5_16k
ENV DEBIAN_FRONTEND noninteractive
# Set SHELL option explicitly
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008
RUN set -x \
# Install, update & upgrade packages
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
ca-certificates \
wget \
gnupg \
&& wget --progress=dot:giga https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list \
&& (wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg) \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
box64-rpi5arm64ps16k
############################################################
FROM arm64v8/debian:bookworm-slim as box64_rpi4
ENV DEBIAN_FRONTEND noninteractive
# Set SHELL option explicitly
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008
RUN set -x \
# Install, update & upgrade packages
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
ca-certificates \
wget \
gnupg \
&& wget --progress=dot:giga https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list \
&& (wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg) \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
box64-rpi4arm64
############################################################
FROM arm64v8/debian:bookworm-slim as box64_rpi4_0.2.7
ENV DEBIAN_FRONTEND noninteractive
# Set SHELL option explicitly
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008
RUN set -x \
# Install, update & upgrade packages
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
ca-certificates \
wget \
gnupg \
&& wget --progress=dot:giga https://github.com/Pi-Apps-Coders/box64-debs/raw/064eb3cffe90fa40d5ab44325a90720c28aaae2b/debian/box64-rpi4arm64_0.2.7+20240521T063129.3882a98-1_arm64.deb -O ./box64-0.2.7.deb \
&& dpkg -i ./box64-0.2.7.deb
############################################################
FROM arm64v8/debian:bookworm-slim as box64_rpi3
ENV DEBIAN_FRONTEND noninteractive
# Set SHELL option explicitly
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008
RUN set -x \
# Install, update & upgrade packages
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
ca-certificates \
wget \
gnupg \
&& wget --progress=dot:giga https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list \
&& (wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg) \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
box64-rpi3arm64
############################################################
FROM arm64v8/debian:bookworm-slim as box64_rk3588
ENV DEBIAN_FRONTEND noninteractive
# Set SHELL option explicitly
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008
RUN set -x \
# Install, update & upgrade packages
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
ca-certificates \
wget \
gnupg \
&& wget --progress=dot:giga https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list \
&& (wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg) \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
box64-rk3588
############################################################
FROM arm64v8/python:slim-bookworm as box64_adlink
ENV DEBIAN_FRONTEND noninteractive
# Set SHELL option explicitly
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008
RUN set -x \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
git \
ca-certificates \
build-essential \
cmake \
mold \
&& git clone https://github.com/ptitSeb/box64.git \
&& mkdir /box64/build \
&& cd /box64/build \
&& cmake .. -D ADLINK=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo -D WITH_MOLD=1 \
&& mold -run make -j$(nproc) \
&& make install DESTDIR=/tmp/install
############################################################
# Dockerfile that contains SteamCMD and Box86/64
############################################################
FROM arm64v8/debian:bookworm-slim as build_stage
LABEL maintainer="[email protected]"
ARG PUID=1000
ENV USER steam
ENV HOMEDIR "/home/${USER}"
ENV STEAMCMDDIR "${HOMEDIR}/steamcmd"
ENV DEBIAN_FRONTEND noninteractive
ENV DEBUGGER "/usr/local/bin/box86"
ENV LD_LIBRARY_PATH "${LD_LIBRARY_PATH}:/usr/lib/box64-x86_64-linux-gnu"
# Set SHELL option explicitly
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
COPY --from=box64_m1 /usr/local/bin/box64 /usr/local/bin/box64-m1
COPY --from=box64_rpi5_4k /usr/local/bin/box64 /usr/local/bin/box64-rpi5
COPY --from=box64_rpi5_16k /usr/local/bin/box64 /usr/local/bin/box64-rpi5-16k
COPY --from=box64_rpi4 /usr/local/bin/box64 /usr/local/bin/box64-rpi4
COPY --from=box64_rpi4_0.2.7 /usr/local/bin/box64 /usr/local/bin/box64-rpi4-0_2_7
COPY --from=box64_rpi3 /usr/local/bin/box64 /usr/local/bin/box64-rpi3
COPY --from=box64_rk3588 /usr/local/bin/box64 /usr/local/bin/box64-rk3588
COPY --from=box64_adlink /tmp/install/usr/local/bin/box64 /usr/local/bin/box64-adlink
# hadolint ignore=DL3008
RUN set -x \
# Install, update & upgrade packages
&& dpkg --add-architecture armhf \
&& dpkg --add-architecture i386 \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
libc6:i386 \
libc6:armhf \
libstdc++6:i386 \
libstdc++6:armhf \
libcurl4 \
libcurl4:i386 \
libnuma1 \
libnuma1:i386 \
libglib2.0-0 \
libglib2.0-0:i386 \
openssl \
ca-certificates \
nano \
curl \
locales \
wget \
gnupg \
&& wget --progress=dot:giga https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list \
&& (wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg) \
&& wget --progress=dot:giga https://ryanfortner.github.io/box86-debs/box86.list -O /etc/apt/sources.list.d/box86.list \
&& (wget -qO- https://ryanfortner.github.io/box86-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg) \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
box64 \
&& apt-get download -y \
box86-generic-arm \
&& dpkg-deb -R *.deb box86_tmp \
&& rm -rf box86_tmp/usr/lib/i386-linux-gnu/libstdc++.so* \
&& dpkg-deb -b box86_tmp new_box86.deb \
&& dpkg -i new_box86.deb \
&& rm -rf *.deb \
&& rm -rf box86_tmp \
&& sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
&& dpkg-reconfigure --frontend=noninteractive locales \
# Create unprivileged user
&& useradd -l -u "${PUID}" -m "${USER}" \
# Download SteamCMD, execute as user
&& su "${USER}" -c \
"mkdir -p \"${STEAMCMDDIR}\" \
&& curl -fsSL 'https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz' | tar xvzf - -C \"${STEAMCMDDIR}\" \
&& ${STEAMCMDDIR}/steamcmd.sh +quit \
&& ln -s \"${STEAMCMDDIR}/linux32/steamclient.so\" \"${STEAMCMDDIR}/steamservice.so\" \
&& mkdir -p \"${HOMEDIR}/.steam/sdk32\" \
&& ln -s \"${STEAMCMDDIR}/linux32/steamclient.so\" \"${HOMEDIR}/.steam/sdk32/steamclient.so\" \
&& ln -s \"${STEAMCMDDIR}/linux32/steamcmd\" \"${STEAMCMDDIR}/linux32/steam\" \
&& mkdir -p \"${HOMEDIR}/.steam/sdk64\" \
&& ln -s \"${STEAMCMDDIR}/linux64/steamclient.so\" \"${HOMEDIR}/.steam/sdk64/steamclient.so\" \
&& ln -s \"${STEAMCMDDIR}/linux64/steamcmd\" \"${STEAMCMDDIR}/linux64/steam\" \
&& ln -s \"${STEAMCMDDIR}/steamcmd.sh\" \"${STEAMCMDDIR}/steam.sh\"" \
# Symlink steamclient.so; So misconfigured dedicated servers can find it
&& mkdir -p /usr/lib/x86_64-linux-gnu \
&& ln -s "${STEAMCMDDIR}/linux64/steamclient.so" "/usr/lib/x86_64-linux-gnu/steamclient.so" \
&& ln -s "${STEAMCMDDIR}/linux32/steamclient.so" "/usr/lib/i386-linux-gnu/steamclient.so" \
&& rm -rf /var/lib/apt/lists/* \
&& mv /usr/local/bin/box64 /usr/local/bin/box64-generic \
&& (for file in /usr/lib/box64-x86_64-linux-gnu/*; do [ -e "/usr/lib/x86_64-linux-gnu/$(basename "$file")" ] || ln -s "$file" /usr/lib/x86_64-linux-gnu/; done)
COPY box64.sh /usr/local/bin/box64
RUN chmod +x /usr/local/bin/box64
FROM build_stage AS bookworm-root
WORKDIR ${STEAMCMDDIR}
FROM bookworm-root AS bookworm
# Switch to user
USER ${USER}