diff --git a/src/ue4docker/dockerfiles/ue4-build-prerequisites/linux/Dockerfile b/src/ue4docker/dockerfiles/ue4-build-prerequisites/linux/Dockerfile index b41a644c..d4dba0af 100644 --- a/src/ue4docker/dockerfiles/ue4-build-prerequisites/linux/Dockerfile +++ b/src/ue4docker/dockerfiles/ue4-build-prerequisites/linux/Dockerfile @@ -28,6 +28,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ curl \ git \ git-lfs \ + gpg-agent \ python3 \ python3-dev \ python3-pip \ @@ -93,5 +94,18 @@ RUN useradd --create-home --home /home/ue4 --shell /bin/bash --uid 1000 ue4 && \ usermod -a -G audio,video,sudo ue4 USER ue4 +{% if enable_ushell %} +# Install Python 3.12, which is required by ushell +USER root +RUN add-apt-repository -y ppa:deadsnakes/ppa && \ + apt-get update && \ + apt-get install -y --no-install-recommends python3.12 python3.12-venv && \ + rm -rf /var/lib/apt/lists/* +USER ue4 + +# Install a copy of pip for Python 3.12 +RUN curl -fsSL 'https://bootstrap.pypa.io/get-pip.py' | python3.12 +{% endif %} + # Enable Git Large File Storage (LFS) support RUN git lfs install diff --git a/src/ue4docker/dockerfiles/ue4-minimal/linux/Dockerfile b/src/ue4docker/dockerfiles/ue4-minimal/linux/Dockerfile index 9f67c5d2..38cd9d6b 100644 --- a/src/ue4docker/dockerfiles/ue4-minimal/linux/Dockerfile +++ b/src/ue4docker/dockerfiles/ue4-minimal/linux/Dockerfile @@ -49,6 +49,9 @@ RUN ./Engine/Build/BatchFiles/RunUAT.sh BuildGraph \ COPY split-components.py /tmp/split-components.py RUN python3 /tmp/split-components.py /home/ue4/UnrealEngine/LocalBuilds/Engine/Linux /home/ue4/UnrealEngine/Components +# Ensure UnrealVersionSelector is built, since the prebuilt binaries may not be up-to-date +RUN ./Engine/Build/BatchFiles/Linux/Build.sh UnrealVersionSelector Linux Shipping + # Copy InstalledBuild.txt from the Installed Build and run UnrealVersionSelector to populate Install.ini with any custom Build ID specified in the BuildGraph flags # (Note that the `-unattended` flag used below requires Unreal Engine 4.22 or newer, so this will break under older versions) # (Note also that custom Build IDs are supported by Unreal Engine 5.3.1 and newer, and older versions will just use a GUID as the Build ID) @@ -72,6 +75,13 @@ COPY --chown=ue4:ue4 copy-toolchain.py /tmp/copy-toolchain.py RUN python3 /tmp/copy-toolchain.py /home/ue4/UnrealEngine {% endif %} +{% if enable_ushell %} +# Ensure ushell is copied to the Installed Build +RUN rm -rf ./LocalBuilds/Engine/Linux/Engine/Extras/ushell && \ + cp -r ./Engine/Extras/ushell ./LocalBuilds/Engine/Linux/Engine/Extras/ushell && \ + bash -c 'set -e; shopt -s globstar; cd /home/ue4/UnrealEngine/LocalBuilds/Engine/Linux/Engine/Extras/ushell && chmod +x ./**/*.sh' +{% endif %} + # Copy the Installed Build into a clean image, discarding the source build {% if combine %} FROM prerequisites as minimal @@ -103,6 +113,15 @@ LABEL com.adamrehn.ue4-docker.excluded.debug={% if excluded_components.debug == LABEL com.adamrehn.ue4-docker.excluded.templates={% if excluded_components.templates == true %}1{% else %}0{% endif %} {% endif %} +{% if enable_ushell %} +# Add ushell to the system PATH and alias `ushell` to `ushell.sh` +ENV PATH="$PATH:/home/ue4/UnrealEngine/Engine/Extras/ushell" +RUN echo 'alias ushell="ushell.sh"' >> /home/ue4/.bashrc + +# Perform first-run setup for ushell +RUN bash -c 'set -e; source /home/ue4/UnrealEngine/Engine/Extras/ushell/ushell.sh && exit 0' +{% endif %} + # Perform first-run setup for Mono, UnrealBuildTool and AutomationTool, which makes it possible to build Unreal projects and plugins as users other than `ue4` # (Note that this will only work with 4.26.0 and newer, older Engine versions will always require write access to `/home/ue4/UnrealEngine`) # See the comments on this issue for details, including the need to ensure $HOME is set correctly: