diff --git a/src/ue4docker/build.py b/src/ue4docker/build.py index b1ecf7f..72ae365 100644 --- a/src/ue4docker/build.py +++ b/src/ue4docker/build.py @@ -86,6 +86,24 @@ def build(): ) sys.exit(1) + # Warn the user if they're using an older version of Docker that can't build or run UE 5.4 images without config changes + if ( + config.containerPlatform == "linux" + and DockerUtils.isVersionWithoutIPV6Loopback() + ): + logger.warning( + "\n".join( + [ + "Warning: detected a Docker version older than 26.0.0.", + "Older versions of Docker cannot build or run images for Unreal Engine 5.4 or", + "newer unless the Docker daemon is explicitly configured to enable IPv6 support.", + "For details, see: https://github.com/adamrehn/ue4-docker/issues/357", + "", + ] + ), + False, + ) + # Create an auto-deleting temporary directory to hold our build context with tempfile.TemporaryDirectory() as tempDir: contextOrig = join(os.path.dirname(os.path.abspath(__file__)), "dockerfiles") diff --git a/src/ue4docker/infrastructure/DockerUtils.py b/src/ue4docker/infrastructure/DockerUtils.py index 54b447b..0515593 100644 --- a/src/ue4docker/infrastructure/DockerUtils.py +++ b/src/ue4docker/infrastructure/DockerUtils.py @@ -1,5 +1,6 @@ import docker, fnmatch, humanfriendly, itertools, json, logging, os, platform, re from docker.models.containers import Container +from packaging.version import Version from .FilesystemUtils import FilesystemUtils @@ -32,6 +33,15 @@ def info(): client = docker.from_env() return client.info() + @staticmethod + def isVersionWithoutIPV6Loopback(): + """ + Determines if the version of the Docker daemon lacks support for using the + IPv6 loopback address [::1] when using its default network configuration + """ + dockerVersion = Version(DockerUtils.version()["Version"]) + return dockerVersion < Version("26.0.0") + @staticmethod def exists(name): """