Skip to content

Commit 1a0f92c

Browse files
committed
Split subdirectories into separate layers under Windows (see #359)
1 parent e365b45 commit 1a0f92c

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

src/ue4docker/dockerfiles/ue4-minimal/windows/Dockerfile

+10-4
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ RUN .\Engine\Build\BatchFiles\RunUAT.bat BuildGraph `
3737
(if exist C:\UnrealEngine\LocalBuilds\InstalledDDC rmdir /s /q C:\UnrealEngine\LocalBuilds\InstalledDDC) && `
3838
rmdir /s /q C:\UnrealEngine\Engine
3939

40-
# Split out components (DDC, debug symbols, template projects) so they can be copied into the final container image as separate filesystem layers
41-
COPY split-components.py C:\split-components.py
42-
RUN python C:\split-components.py C:\UnrealEngine\LocalBuilds\Engine\Windows C:\UnrealEngine\Components
43-
4440
{% if (not disable_all_patches) and (not disable_target_patches) %}
4541
# Ensure Client and Server targets have their `PlatformType` field set correctly in BaseEngine.ini
4642
COPY fix-targets.py C:\fix-targets.py
4743
RUN python C:\fix-targets.py C:\UnrealEngine\LocalBuilds\Engine\Windows\Engine\Config\BaseEngine.ini
4844
{% endif %}
4945

46+
# Split out components (DDC, debug symbols, template projects) so they can be copied into the final container image as separate filesystem layers
47+
COPY split-components.py C:\split-components.py
48+
RUN python C:\split-components.py C:\UnrealEngine\LocalBuilds\Engine\Windows C:\UnrealEngine\Components
49+
5050
# Copy the Installed Build into a clean image, discarding the source tree
5151
{% if combine %}
5252
FROM prerequisites as minimal
@@ -57,6 +57,12 @@ FROM ${NAMESPACE}/ue4-build-prerequisites:${PREREQS_TAG}
5757

5858
# Copy the Installed Build files from the builder image
5959
COPY --from=builder C:\UnrealEngine\LocalBuilds\Engine\Windows C:\UnrealEngine
60+
COPY --from=builder C:\UnrealEngine\Components\Binaries C:\UnrealEngine
61+
COPY --from=builder C:\UnrealEngine\Components\Content C:\UnrealEngine
62+
COPY --from=builder C:\UnrealEngine\Components\Extras C:\UnrealEngine
63+
COPY --from=builder C:\UnrealEngine\Components\Intermediate C:\UnrealEngine
64+
COPY --from=builder C:\UnrealEngine\Components\Plugins C:\UnrealEngine
65+
COPY --from=builder C:\UnrealEngine\Components\Source C:\UnrealEngine
6066
{% if excluded_components.ddc == false %}
6167
COPY --from=builder C:\UnrealEngine\Components\DDC C:\UnrealEngine
6268
{% endif %}

src/ue4docker/dockerfiles/ue4-minimal/windows/split-components.py

+10
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,13 @@ def extractComponent(inputDir, outputDir, component, description, items):
5656
extractComponent(
5757
rootDir, outputDir, "TemplatesAndSamples", "template projects and samples", subdirs
5858
)
59+
60+
# Extract the larger non-optional subdirectories of the Engine directory
61+
for subdir in ["Binaries", "Content", "Extras", "Intermediate", "Plugins", "Source"]:
62+
extractComponent(
63+
rootDir,
64+
outputDir,
65+
subdir,
66+
f"{subdir} subdirectory",
67+
[join(rootDir, "Engine", subdir)],
68+
)

0 commit comments

Comments
 (0)