From 4a9eeb650cda8d2ce7e7cdef587989755edc7adc Mon Sep 17 00:00:00 2001 From: Brad Saracik <35494318+bradsaracik@users.noreply.github.com> Date: Tue, 30 Sep 2025 14:52:45 +0800 Subject: [PATCH 1/6] patch linux older ue with CDN gitdeps.xml matching release --- .../ue4-source/linux/patch-broken-releases.py | 45 ++++++++++++++++--- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/src/ue4docker/dockerfiles/ue4-source/linux/patch-broken-releases.py b/src/ue4docker/dockerfiles/ue4-source/linux/patch-broken-releases.py index 5dc2bf55..0fbb9b06 100644 --- a/src/ue4docker/dockerfiles/ue4-source/linux/patch-broken-releases.py +++ b/src/ue4docker/dockerfiles/ue4-source/linux/patch-broken-releases.py @@ -2,6 +2,8 @@ import json import sys from os.path import join +import os +import requests def readFile(filename): @@ -20,11 +22,11 @@ def writeFile(filename, data): readFile(join(engineRoot, "Engine", "Build", "Build.version")) ) -if ( - versionDetails["MajorVersion"] == 5 - and versionDetails["MinorVersion"] == 0 - and versionDetails["PatchVersion"] == 0 -): +major = versionDetails["MajorVersion"] +minor = versionDetails["MinorVersion"] +patch = versionDetails["PatchVersion"] + +if major == 5 and minor == 0 and patch == 0: buildFile = join(engineRoot, "Engine", "Build", "InstalledEngineFilters.xml") buildXml = readFile(buildFile) @@ -42,3 +44,36 @@ def writeFile(filename, data): print("PATCHED {}:\n\n{}".format(buildFile, buildXml), file=sys.stderr) else: print("PATCHED {}".format(buildFile), file=sys.stderr) + +if major < 5 or (major == 5 and minor < 2): + gitdepsFile = join(engineRoot, "Engine", "Build", "Commit.gitdeps.xml") + # See https://forums.unrealengine.com/t/upcoming-disruption-of-service-impacting-unreal-engine-users-on-github/1155880 + # In May 2023, Epics broke Commit.gitdeps.xml for *all existing releases up to 5.1.1* due to changes in their CDN + # we need to authenticate + password = os.getenv("GITPASS") + # eg curl -L \ + # -H "Accept: application/vnd.github+json" \ + # -H "Authorization: Bearer ghp_secretGoesHere" \ + # -H "X-GitHub-Api-Version: 2022-11-28" \ + # https://api.github.com/repos/EpicGames/UnrealEngine/releases/tags/4.27.2-release + gitdepsUrl = f"https://api.github.com/repos/EpicGames/UnrealEngine/releases/tags/{major}.{minor}.{patch}-release" + headers = { + "Accept": "application/vnd.github+json", + "Authorization": "Bearer " + password.strip(), + "X-GitHub-Api-Version": "2022-11-28", + } + with requests.get(gitdepsUrl, headers=headers) as response: + assets = response.json()["assets"] + if len(assets) == 1: + gitdepsUrl = assets[0]["url"] + + # eg gitdepsUrl = f"https://api.github.com/repos/EpicGames/UnrealEngine/releases/assets/107274338" + headers["Accept"] = "application/octet-stream" + with requests.get(gitdepsUrl, headers=headers) as response: + gitdepsXml = response.text.replace("&", "&") + writeFile(gitdepsFile, gitdepsXml) + + if verboseOutput: + print("PATCHED {}:\n\n{}".format(gitdepsFile, gitdepsXml), file=sys.stderr) + else: + print("PATCHED {}".format(gitdepsFile), file=sys.stderr) From 02ad8f66f1dc7a564ff6c414c5d9a3f1eefd048b Mon Sep 17 00:00:00 2001 From: Brad Saracik <35494318+bradsaracik@users.noreply.github.com> Date: Tue, 30 Sep 2025 15:49:28 +0800 Subject: [PATCH 2/6] Dockerfile for source patch with requests and credentials --- src/ue4docker/dockerfiles/ue4-source/linux/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ue4docker/dockerfiles/ue4-source/linux/Dockerfile b/src/ue4docker/dockerfiles/ue4-source/linux/Dockerfile index 1e5a1837..65daff13 100644 --- a/src/ue4docker/dockerfiles/ue4-source/linux/Dockerfile +++ b/src/ue4docker/dockerfiles/ue4-source/linux/Dockerfile @@ -87,7 +87,9 @@ ARG VERBOSE_OUTPUT=0 # Apply our bugfix patches to broken Engine releases # (Make sure we do this before the post-clone setup steps are run) COPY --chown=ue4:ue4 patch-broken-releases.py /tmp/patch-broken-releases.py -RUN python3 /tmp/patch-broken-releases.py /home/ue4/UnrealEngine $VERBOSE_OUTPUT +RUN --mount=type=secret,id=password,env=GITPASS,uid=1000,required \ + sudo apt-get update && sudo apt-get install -y --no-install-recommends python3-requests && sudo rm -rf /var/lib/apt/lists/* \ + && python3 /tmp/patch-broken-releases.py /home/ue4/UnrealEngine $VERBOSE_OUTPUT {% endif %} # Run post-clone setup steps, ensuring our package lists are up to date since Setup.sh doesn't call `apt-get update` From a94827c94abc1f5e544b2fbed70eef75ab359b65 Mon Sep 17 00:00:00 2001 From: Brad Saracik <35494318+bradsaracik@users.noreply.github.com> Date: Tue, 30 Sep 2025 16:12:21 +0800 Subject: [PATCH 3/6] linux to uid gid 2000. prep for ubuntu24 1000 taken --- .../dockerfiles/ue4-build-prerequisites/linux/Dockerfile | 2 +- .../dockerfiles/ue4-full/linux/pulseaudio-client.conf | 2 +- src/ue4docker/dockerfiles/ue4-source/linux/Dockerfile | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ue4docker/dockerfiles/ue4-build-prerequisites/linux/Dockerfile b/src/ue4docker/dockerfiles/ue4-build-prerequisites/linux/Dockerfile index faeca470..5c01a4af 100644 --- a/src/ue4docker/dockerfiles/ue4-build-prerequisites/linux/Dockerfile +++ b/src/ue4docker/dockerfiles/ue4-build-prerequisites/linux/Dockerfile @@ -89,7 +89,7 @@ ENV GLIBC_TUNABLES=glibc.rtld.dynamic_sort=2 RUN echo 'Defaults lecture="never"' >> /etc/sudoers # Unreal refuses to run as the root user, so create a non-root user with no password and allow them to run commands using sudo -RUN useradd --create-home --home /home/ue4 --shell /bin/bash --uid 1000 ue4 && \ +RUN useradd --create-home --home /home/ue4 --shell /bin/bash --uid 2000 ue4 && \ passwd -d ue4 && \ usermod -a -G audio,video,sudo ue4 USER ue4 diff --git a/src/ue4docker/dockerfiles/ue4-full/linux/pulseaudio-client.conf b/src/ue4docker/dockerfiles/ue4-full/linux/pulseaudio-client.conf index 610b1d0d..3a30747b 100644 --- a/src/ue4docker/dockerfiles/ue4-full/linux/pulseaudio-client.conf +++ b/src/ue4docker/dockerfiles/ue4-full/linux/pulseaudio-client.conf @@ -1,5 +1,5 @@ # Connect to the host's PulseAudio server using the mounted UNIX socket -default-server = unix:/run/user/1000/pulse/native +default-server = unix:/run/user/2000/pulse/native # Prevent a PulseAudio server from running in the container autospawn = no diff --git a/src/ue4docker/dockerfiles/ue4-source/linux/Dockerfile b/src/ue4docker/dockerfiles/ue4-source/linux/Dockerfile index 65daff13..782d4fe7 100644 --- a/src/ue4docker/dockerfiles/ue4-source/linux/Dockerfile +++ b/src/ue4docker/dockerfiles/ue4-source/linux/Dockerfile @@ -31,8 +31,8 @@ RUN chmod +x /tmp/git-credential-helper-secrets.sh # (Note that we include the changelist override value here to ensure any cached source code is invalidated if # the override is modified between runs, which is useful when testing preview versions of the Unreal Engine) ARG CHANGELIST -RUN --mount=type=secret,id=username,uid=1000,required \ - --mount=type=secret,id=password,uid=1000,required \ +RUN --mount=type=secret,id=username,uid=2000,required \ + --mount=type=secret,id=password,uid=2000,required \ CHANGELIST="$CHANGELIST" \ mkdir /home/ue4/UnrealEngine && \ cd /home/ue4/UnrealEngine && \ @@ -87,7 +87,7 @@ ARG VERBOSE_OUTPUT=0 # Apply our bugfix patches to broken Engine releases # (Make sure we do this before the post-clone setup steps are run) COPY --chown=ue4:ue4 patch-broken-releases.py /tmp/patch-broken-releases.py -RUN --mount=type=secret,id=password,env=GITPASS,uid=1000,required \ +RUN --mount=type=secret,id=password,env=GITPASS,uid=2000,required \ sudo apt-get update && sudo apt-get install -y --no-install-recommends python3-requests && sudo rm -rf /var/lib/apt/lists/* \ && python3 /tmp/patch-broken-releases.py /home/ue4/UnrealEngine $VERBOSE_OUTPUT {% endif %} @@ -102,7 +102,7 @@ RUN mkdir "$UE_GITDEPS" # When running with BuildKit, we use a cache mount to cache the dependency data across multiple build invocations WORKDIR /home/ue4/UnrealEngine -RUN --mount=type=cache,target=/home/ue4/gitdeps,uid=1000,gid=1000 sudo apt-get update && \ +RUN --mount=type=cache,target=/home/ue4/gitdeps,uid=2000,gid=2000 sudo apt-get update && \ ./Setup.sh {{ gitdependencies_args }} && \ sudo rm -rf /var/lib/apt/lists/* From bdd5ae73f15c297295de1a386c3433fd60f6e50c Mon Sep 17 00:00:00 2001 From: Brad Saracik <35494318+bradsaracik@users.noreply.github.com> Date: Tue, 30 Sep 2025 16:46:56 +0800 Subject: [PATCH 4/6] ubuntu oracular or newer updates libasound2 dependency --- .../ue4-build-prerequisites/linux/Dockerfile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ue4docker/dockerfiles/ue4-build-prerequisites/linux/Dockerfile b/src/ue4docker/dockerfiles/ue4-build-prerequisites/linux/Dockerfile index 5c01a4af..2a475fa5 100644 --- a/src/ue4docker/dockerfiles/ue4-build-prerequisites/linux/Dockerfile +++ b/src/ue4docker/dockerfiles/ue4-build-prerequisites/linux/Dockerfile @@ -44,8 +44,15 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # Install the X11 runtime libraries required by CEF so we can cook Unreal Engine projects that use the WebBrowserWidget plugin # (Starting in Unreal Engine 5.0, we need these installed before creating an Installed Build to prevent cooking failures related to loading the Quixel Bridge plugin) -RUN apt-get update && apt-get install -y --no-install-recommends \ - libasound2 \ +RUN apt-get update && \ + OS_NAME=$(grep "^NAME=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') && \ + OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') && \ + if [ "$OS_NAME" = "Ubuntu" ] && dpkg --compare-versions "$OS_VERSION" ge "24.04"; then \ + LIBASOUND2="libasound2t64"; \ + else \ + LIBASOUND2="libasound2"; \ + fi && apt-get install -y --no-install-recommends \ + $LIBASOUND2 libatk1.0-0 \ libatk-bridge2.0-0 \ libcairo2 \ From becf22f08482335054aecc8bfe61e6ae28e89928 Mon Sep 17 00:00:00 2001 From: Brad Saracik <35494318+bradsaracik@users.noreply.github.com> Date: Tue, 30 Sep 2025 17:19:34 +0800 Subject: [PATCH 5/6] enable ubuntu24 global pip update in docker stages --- src/ue4docker/dockerfiles/ue4-full/linux/Dockerfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ue4docker/dockerfiles/ue4-full/linux/Dockerfile b/src/ue4docker/dockerfiles/ue4-full/linux/Dockerfile index b8da8539..ff0635f1 100644 --- a/src/ue4docker/dockerfiles/ue4-full/linux/Dockerfile +++ b/src/ue4docker/dockerfiles/ue4-full/linux/Dockerfile @@ -15,8 +15,9 @@ ARG CONAN_VERSION # Install ue4cli and conan-ue4cli USER root -RUN pip3 install --upgrade pip setuptools wheel -RUN pip3 install "$CONAN_VERSION" "$UE4CLI_VERSION" "$CONAN_UE4CLI_VERSION" +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +RUN pip3 install --ignore-installed --upgrade pip setuptools wheel +RUN pip3 install --ignore-installed "$CONAN_VERSION" "$UE4CLI_VERSION" "$CONAN_UE4CLI_VERSION" USER ue4 # Extract the third-party library details from UBT @@ -36,8 +37,9 @@ ARG CONAN_VERSION # Install CMake, ue4cli, conan-ue4cli, and ue4-ci-helpers USER root RUN apt-get update && apt-get install -y --no-install-recommends cmake -RUN pip3 install --upgrade pip setuptools wheel -RUN pip3 install "$CONAN_VERSION" "$UE4CLI_VERSION" "$CONAN_UE4CLI_VERSION" ue4-ci-helpers +ENV PIP_BREAK_SYSTEM_PACKAGES=1 +RUN pip3 install --ignore-installed --upgrade pip setuptools wheel +RUN pip3 install --ignore-installed "$CONAN_VERSION" "$UE4CLI_VERSION" "$CONAN_UE4CLI_VERSION" ue4-ci-helpers USER ue4 # Explicitly set the configuration directory for ue4cli From 977bd08a74626075244f40363d7ef86891eaa20a Mon Sep 17 00:00:00 2001 From: Brad Saracik <35494318+bradsaracik@users.noreply.github.com> Date: Thu, 2 Oct 2025 11:49:28 +0800 Subject: [PATCH 6/6] fix libasound2 commit with end of line slash --- .../dockerfiles/ue4-build-prerequisites/linux/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ue4docker/dockerfiles/ue4-build-prerequisites/linux/Dockerfile b/src/ue4docker/dockerfiles/ue4-build-prerequisites/linux/Dockerfile index 2a475fa5..28a230b7 100644 --- a/src/ue4docker/dockerfiles/ue4-build-prerequisites/linux/Dockerfile +++ b/src/ue4docker/dockerfiles/ue4-build-prerequisites/linux/Dockerfile @@ -52,7 +52,7 @@ RUN apt-get update && \ else \ LIBASOUND2="libasound2"; \ fi && apt-get install -y --no-install-recommends \ - $LIBASOUND2 + $LIBASOUND2 \ libatk1.0-0 \ libatk-bridge2.0-0 \ libcairo2 \