Skip to content

Commit

Permalink
Split subdirectories into separate layers under Windows (see #359)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamrehn committed Jun 24, 2024
1 parent e365b45 commit 1a0f92c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/ue4docker/dockerfiles/ue4-minimal/windows/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ RUN .\Engine\Build\BatchFiles\RunUAT.bat BuildGraph `
(if exist C:\UnrealEngine\LocalBuilds\InstalledDDC rmdir /s /q C:\UnrealEngine\LocalBuilds\InstalledDDC) && `
rmdir /s /q C:\UnrealEngine\Engine

# Split out components (DDC, debug symbols, template projects) so they can be copied into the final container image as separate filesystem layers
COPY split-components.py C:\split-components.py
RUN python C:\split-components.py C:\UnrealEngine\LocalBuilds\Engine\Windows C:\UnrealEngine\Components

{% if (not disable_all_patches) and (not disable_target_patches) %}
# Ensure Client and Server targets have their `PlatformType` field set correctly in BaseEngine.ini
COPY fix-targets.py C:\fix-targets.py
RUN python C:\fix-targets.py C:\UnrealEngine\LocalBuilds\Engine\Windows\Engine\Config\BaseEngine.ini
{% endif %}

# Split out components (DDC, debug symbols, template projects) so they can be copied into the final container image as separate filesystem layers
COPY split-components.py C:\split-components.py
RUN python C:\split-components.py C:\UnrealEngine\LocalBuilds\Engine\Windows C:\UnrealEngine\Components

# Copy the Installed Build into a clean image, discarding the source tree
{% if combine %}
FROM prerequisites as minimal
Expand All @@ -57,6 +57,12 @@ FROM ${NAMESPACE}/ue4-build-prerequisites:${PREREQS_TAG}

# Copy the Installed Build files from the builder image
COPY --from=builder C:\UnrealEngine\LocalBuilds\Engine\Windows C:\UnrealEngine
COPY --from=builder C:\UnrealEngine\Components\Binaries C:\UnrealEngine
COPY --from=builder C:\UnrealEngine\Components\Content C:\UnrealEngine
COPY --from=builder C:\UnrealEngine\Components\Extras C:\UnrealEngine
COPY --from=builder C:\UnrealEngine\Components\Intermediate C:\UnrealEngine
COPY --from=builder C:\UnrealEngine\Components\Plugins C:\UnrealEngine
COPY --from=builder C:\UnrealEngine\Components\Source C:\UnrealEngine
{% if excluded_components.ddc == false %}
COPY --from=builder C:\UnrealEngine\Components\DDC C:\UnrealEngine
{% endif %}
Expand Down
10 changes: 10 additions & 0 deletions src/ue4docker/dockerfiles/ue4-minimal/windows/split-components.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,13 @@ def extractComponent(inputDir, outputDir, component, description, items):
extractComponent(
rootDir, outputDir, "TemplatesAndSamples", "template projects and samples", subdirs
)

# Extract the larger non-optional subdirectories of the Engine directory
for subdir in ["Binaries", "Content", "Extras", "Intermediate", "Plugins", "Source"]:
extractComponent(
rootDir,
outputDir,
subdir,
f"{subdir} subdirectory",
[join(rootDir, "Engine", subdir)],
)

0 comments on commit 1a0f92c

Please sign in to comment.