Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions src/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1.2

FROM alpine:3.15.4 AS base
FROM alpine:3.23.0 AS base

FROM base AS build
RUN apk update && apk add alpine-sdk sudo
Expand All @@ -12,10 +12,6 @@ USER nsbuild
RUN mkdir -p /nsbuild/src/main /nsbuild/packages/main && \
abuild-keygen -ain

FROM build AS build-wine
COPY --chown=nsbuild:nsbuild ./wine/ /nsbuild/src/main/wine/
RUN ulimit -n 1024; cd /nsbuild/src/main/wine && abuild -r

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
Expand All @@ -29,18 +25,13 @@ 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 gnutls tzdata ca-certificates sudo
RUN --mount=from=build-wine,source=/nsbuild/packages/main/x86_64,target=/nsbuild/wine \
apk add --no-cache --allow-untrusted /nsbuild/wine/northstar-dedicated-wine-[0-9]*-r*.apk xvfb
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

# silence Xvfb xkbcomp warnings by working around the bug (present in libX11 1.7.2) fixed in libX11 1.8 by https://gitlab.freedesktop.org/xorg/lib/libx11/-/merge_requests/79
RUN echo 'partial xkb_symbols "evdev" {};' > /usr/share/X11/xkb/symbols/inet

RUN adduser -D northstar && \
echo 'northstar ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/northstar && \
mkdir /mnt/titanfall /mnt/mods /mnt/navs /mnt/plugins
Expand Down
7 changes: 4 additions & 3 deletions src/entrypoint/nsinit.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,11 @@ func main() {

cmd := &exec.Cmd{
Path: "/usr/bin/nswrap",
Args: append([]string{"nswrap", nso.Path}, args...),
Dir: nso.Path,
Args: append([]string{"nswrap", "-dedicated"}, args...),
Env: env([]string{"PATH", "HOSTNAME", "HOME", "USER", "WINEPREFIX", "WINESERVER"},
"NSWRAP_TITLE", sn,
"DISPLAY", "xvfb",
"NSWRAP_EXTWINE", "1",
"NSWRAP_INSTANCE", sn,
),
Stdin: os.Stdin,
Stdout: os.Stdout,
Expand Down
2 changes: 1 addition & 1 deletion src/nswrap/APKBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sha512sums="$(sha512sum $source)"

build() {
mkdir -p "$builddir"
gcc -Wall -Wextra -Werror -Wno-trampolines -std=gnu11 -O3 -DNSWRAP_HASH="$(sha256sum $source | head -c64)" "nswrap.c" -o "$builddir/nswrap"
gcc -Wall -Wextra -O3 -DNSWRAP_HASH="$(sha256sum $source | head -c64)" "nswrap.c" -o "$builddir/nswrap"
cp "nswrap-wineprefix" "$builddir/nswrap-wineprefix"
}

Expand Down
1 change: 1 addition & 0 deletions src/nswrap/nswrap-wineprefix
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ wine64 wineboot --init

wine64 reg add 'HKCU\Software\Wine' /v 'Version' /t REG_SZ /d 'win10' /f
wine64 reg add 'HKCU\Software\Wine\Drivers' /v 'Audio' /t REG_SZ /d '' /f
wine64 reg add 'HKCU\Software\Wine\Drivers' /v 'Graphics' /t REG_SZ /d 'null' /f
wine64 reg add 'HKCU\Software\Wine\WineDbg' /v 'ShowCrashDialog' /t REG_DWORD /d 0 /f

wine64 reg add 'HKLM\System\CurrentControlSet\Services\WineBus' /v 'DisableHidraw' /t REG_DWORD /d 1 /f
Expand Down
Loading