From 53591d170e05998d4c12fd7d0e3863b9dec6f2e9 Mon Sep 17 00:00:00 2001 From: Tom Deseyn Date: Wed, 12 May 2021 10:04:22 +0200 Subject: [PATCH] Don't consider it a fatal error when the container host is not accessible. (#1027) For many use-cases there is no need to access the host. --- src/Microsoft.Tye.Hosting/DockerRunner.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.Tye.Hosting/DockerRunner.cs b/src/Microsoft.Tye.Hosting/DockerRunner.cs index 0c5969c6..16e0516e 100644 --- a/src/Microsoft.Tye.Hosting/DockerRunner.cs +++ b/src/Microsoft.Tye.Hosting/DockerRunner.cs @@ -202,9 +202,10 @@ namespace Microsoft.Tye.Hosting var hostname = application.ContainerEngine.ContainerHost; if (hostname == null) { - _logger.LogError("Configuration doesn't allow containers to access services on the host."); + _logger.LogWarning("Configuration doesn't allow containers to access services on the host."); - throw new CommandException("Configuration doesn't allow containers to access services on the host."); + // Set a value even though it won't be usable. + hostname = "host.docker.internal"; } var dockerImage = docker.Image ?? service.Description.Name;