File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -256,8 +256,12 @@ tasks:
256256 dir : dispatcher
257257 cmds :
258258 - |
259- if [ "{{OS}}" = "windows" ]; then
259+ if [ "{{OS}}" = "windows" ] && [ "{{.DOCKER_COMMAND}}" = "podman" ] ; then
260260 HOST_IP=$(powershell -command "Get-NetIpAddress | where { \$_.InterfaceAlias -Like '*WSL*' -and \$_.AddressFamily -EQ 'IPv4' } | select -ExpandProperty IPAddress")
261+ if [ -z "$HOST_IP" ]; then
262+ echo "Host IP cannot be determined! WSL cannot run in mirrored networking mode."
263+ exit 1
264+ fi
261265 echo "EXTRA_HOST=host.docker.internal:$HOST_IP" > .env
262266 else
263267 echo "EXTRA_HOST=localhost.dummy:127.0.0.1" > .env
Original file line number Diff line number Diff line change @@ -237,8 +237,12 @@ tasks:
237237 cmds :
238238 - ' command -v {{.DOCKER_COMMAND}} || { echo "Podman or Docker is not installed!"; exit 1; }'
239239 - |
240- if [ "{{OS}}" = "windows" ]; then
240+ if [ "{{OS}}" = "windows" ] && [ "{{.DOCKER_COMMAND}}" = "podman" ] ; then
241241 HOST_IP=$(powershell -command "Get-NetIpAddress | where { \$_.InterfaceAlias -Like '*WSL*' -and \$_.AddressFamily -EQ 'IPv4' } | select -ExpandProperty IPAddress")
242+ if [ -z "$HOST_IP" ]; then
243+ echo "Host IP cannot be determined! WSL cannot run in mirrored networking mode."
244+ exit 1
245+ fi
242246 echo "EXTRA_HOST=host.docker.internal:$HOST_IP" > .env
243247 else
244248 echo "EXTRA_HOST=localhost.dummy:127.0.0.1" > .env
You can’t perform that action at this time.
0 commit comments