Skip to content

Commit

Permalink
Warn users about IPv6 issues when using Docker < 26.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
adamrehn committed Jun 18, 2024
1 parent ea67de4 commit 1aa50f2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/ue4docker/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
10 changes: 10 additions & 0 deletions src/ue4docker/infrastructure/DockerUtils.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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):
"""
Expand Down

0 comments on commit 1aa50f2

Please sign in to comment.