-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathDockerfile
More file actions
64 lines (55 loc) · 2.62 KB
/
Copy pathDockerfile
File metadata and controls
64 lines (55 loc) · 2.62 KB
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
# syntax=docker/dockerfile:1.2
FROM alpine:3.23.0 AS base
FROM base AS build
RUN apk update && apk add alpine-sdk sudo
RUN adduser -Dh /nsbuild nsbuild && \
adduser nsbuild abuild && \
echo 'nsbuild ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/nsbuild
USER nsbuild
RUN mkdir -p /nsbuild/src/main /nsbuild/packages/main && \
abuild-keygen -ain
FROM build AS build-northstar
COPY --chown=nsbuild:nsbuild ./northstar/ /nsbuild/src/main/northstar/
RUN ulimit -n 1024; cd /nsbuild/src/main/northstar && abuild -r
FROM build AS build-nswrap
COPY --chown=nsbuild:nsbuild ./nswrap/ /nsbuild/src/main/nswrap/
RUN ulimit -n 1024; cd /nsbuild/src/main/nswrap && abuild -r
FROM build AS build-entrypoint
COPY --chown=nsbuild:nsbuild ./entrypoint/ /nsbuild/src/main/entrypoint/
RUN ulimit -n 1024; cd /nsbuild/src/main/entrypoint && abuild -r
FROM base
RUN apk add --no-cache wine gnutls tzdata ca-certificates sudo
RUN --mount=from=build-northstar,source=/nsbuild/packages/main/x86_64,target=/nsbuild/northstar \
apk add --no-cache --allow-untrusted /nsbuild/northstar/*.apk
RUN --mount=from=build-nswrap,source=/nsbuild/packages/main/x86_64,target=/nsbuild/nswrap \
--mount=from=build-entrypoint,source=/nsbuild/packages/main/x86_64,target=/nsbuild/entrypoint \
apk add --no-cache --allow-untrusted /nsbuild/nswrap/*.apk /nsbuild/entrypoint/*.apk
RUN adduser -D northstar && \
echo 'northstar ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/northstar && \
mkdir /mnt/titanfall /mnt/mods /mnt/navs /mnt/plugins
USER northstar
ENV WINEPREFIX="/home/northstar/.wine"
RUN /usr/bin/nswrap-wineprefix && \
for x in \
/home/northstar/.wine/drive_c/"Program Files"/"Common Files"/System/*/* \
/home/northstar/.wine/drive_c/windows/* \
/home/northstar/.wine/drive_c/windows/system32/* \
/home/northstar/.wine/drive_c/windows/system32/drivers/* \
/home/northstar/.wine/drive_c/windows/system32/wbem/* \
/home/northstar/.wine/drive_c/windows/system32/spool/drivers/x64/*/* \
/home/northstar/.wine/drive_c/windows/system32/Speech/common/* \
/home/northstar/.wine/drive_c/windows/winsxs/*/* \
; do \
orig="/usr/lib/wine/x86_64-windows/$(basename "$x")"; \
if cmp -s "$orig" "$x"; then ln -sf "$orig" "$x"; fi; \
done && \
for x in \
/home/northstar/.wine/drive_c/windows/globalization/sorting/*.nls \
/home/northstar/.wine/drive_c/windows/system32/*.nls \
; do \
orig="/usr/share/wine/nls/$(basename "$x")"; \
if cmp -s "$orig" "$x"; then ln -sf "$orig" "$x"; fi; \
done
EXPOSE 8081/tcp
EXPOSE 37015/udp
ENTRYPOINT ["/usr/libexec/nsdedi"]