Skip to content

Commit 0ebad5b

Browse files
Windows + Podman fix
1 parent 47c4457 commit 0ebad5b

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

pkg/project/app_classic/Taskfile.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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

pkg/project/app_cloud/Taskfile.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)