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: 10 additions & 3 deletions src/ue4docker/dockerfiles/ue4-build-prerequisites/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -89,7 +96,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
Expand Down
10 changes: 6 additions & 4 deletions src/ue4docker/dockerfiles/ue4-full/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 6 additions & 4 deletions src/ue4docker/dockerfiles/ue4-source/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down Expand Up @@ -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=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 %}

# Run post-clone setup steps, ensuring our package lists are up to date since Setup.sh doesn't call `apt-get update`
Expand All @@ -100,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/*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import json
import sys
from os.path import join
import os
import requests


def readFile(filename):
Expand All @@ -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)

Expand All @@ -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("&", "&amp;")
writeFile(gitdepsFile, gitdepsXml)

if verboseOutput:
print("PATCHED {}:\n\n{}".format(gitdepsFile, gitdepsXml), file=sys.stderr)
else:
print("PATCHED {}".format(gitdepsFile), file=sys.stderr)