You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
maxirass opened this issue
Jan 29, 2025
· 0 comments
Labels
kind/bugCategorizes issue or PR as related to a bug.machinenetworkNetworking related issue or featureremoteProblem is in podman-remotewindowsissue/bug on Windows
I am trying to reach my host from a container (which I use for openapi-generator).
I have already tried different flags and settings.
Neither host.containers.internal nor --network=host can I access the swagger api on localhost:5001.
If I execute ps auxww | grep pasta in the podman-machine-default:
I start an alpine container: podman run --rm -it alpine sh
Then these are the following outputs:
These is the ip route output inside the podman machine:
ip route
default via 172.29.32.1 dev eth0 proto kernel
172.29.32.0/20 dev eth0 proto kernel scope link src 172.29.37.89
I have the problem with Podman v 5.0.0 / 5.3.0 and 5.3.x
The only thing that has worked so far is using networkingMode=mirrored in the .wslconfig
and starting the container with --network=host.
Then I can access the swagger api directly with localhost or 127.0.0.1. However, this causes other problems with my DB, which is why this is not an option!
Steps to reproduce the issue
Create default podman machine
Create standard alpine container and install curl
Some service, like swagger api, is running on the host, e.g. localhost:5001 or 127.0.0.1:5001
Try to curl the swagger.json file
Describe the results you received
From inside the container!
curl -v https://host.containers.internal:5001/swagger/v1/swagger.json
* Host host.containers.internal:5001 was resolved.
* IPv6: (none)
* IPv4: 169.254.1.2
* Trying 169.254.1.2:5001...
* connect to 169.254.1.2 port 5001 from 172.29.37.89 port 42238 failed: Operation timed out
* Failed to connect to host.containers.internal port 5001 after 131710 ms: Could not connect to server
* closing connection #0
curl: (28) Failed to connect to host.containers.internal port 5001 after 131710 ms: Could not connect to server
or
nslookup host.containers.internal
Server: 169.254.1.1
Address: 169.254.1.1:53
** server can't find host.containers.internal: SERVFAIL
** server can't find host.containers.internal: SERVFAIL
but when I ping:
ping host.containers.internal:5001
PING host.containers.internal:5001 (169.254.1.2): 56 data bytes
64 bytes from 169.254.1.2: seq=0 ttl=42 time=0.974 ms
64 bytes from 169.254.1.2: seq=1 ttl=42 time=0.445 ms
64 bytes from 169.254.1.2: seq=2 ttl=42 time=0.449 ms
Describe the results you expected
Host service, like a swagger api, should be reachable from inside the container via host.containers.internal
Output should be similar to the curl command from the windows host (powershell):
curl -v https://localhost:5001/swagger/v1/swagger.json
* Host localhost:5001 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
* Trying [::1]:5001...
* Connected to localhost (::1) port 5001
* schannel: disabled automatic use of client certificate
* ALPN: curl offers http/1.1
* ALPN: server accepted http/1.1
* using HTTP/1.x
> GET /swagger/v1/swagger.json HTTP/1.1
> Host: localhost:5001
> User-Agent: curl/8.9.1
> Accept: */*
podman info output
host:
arch: amd64buildahVersion: 1.38.0cgroupControllers: []cgroupManager: cgroupfscgroupVersion: v1conmon:
package: conmon-2.1.12-2.fc40.x86_64path: /usr/bin/conmonversion: 'conmon version 2.1.12, commit: 'cpuUtilization:
idlePercent: 99.62systemPercent: 0.25userPercent: 0.13cpus: 12databaseBackend: sqlitedistribution:
distribution: fedoravariant: containerversion: "40"eventLogger: journaldfreeLocks: 2048hostname: PASO-070idMappings:
gidmap:
- container_id: 0host_id: 1000size: 1
- container_id: 1host_id: 524288size: 65536uidmap:
- container_id: 0host_id: 1000size: 1
- container_id: 1host_id: 524288size: 65536kernel: 5.15.167.4-microsoft-standard-WSL2linkmode: dynamiclogDriver: journaldmemFree: 41296322560memTotal: 42063781888networkBackend: netavarknetworkBackendInfo:
backend: netavarkdns:
package: aardvark-dns-1.13.1-1.fc40.x86_64path: /usr/libexec/podman/aardvark-dnsversion: aardvark-dns 1.13.1package: netavark-1.13.1-1.fc40.x86_64path: /usr/libexec/podman/netavarkversion: netavark 1.13.1ociRuntime:
name: crunpackage: crun-1.19.1-1.fc40.x86_64path: /usr/bin/crunversion: |- crun version 1.19.1 commit: 3e32a70c93f5aa5fea69b50256cca7fd4aa23c80 rundir: /run/user/1000/crun spec: 1.0.0 +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJLos: linuxpasta:
executable: /usr/bin/pastapackage: passt-0^20241211.g09478d5-1.fc40.x86_64version: | pasta 0^20241211.g09478d5-1.fc40.x86_64 Copyright Red Hat GNU General Public License, version 2 or later <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.remoteSocket:
exists: truepath: unix:///run/user/1000/podman/podman.sockrootlessNetworkCmd: pastasecurity:
apparmorEnabled: falsecapabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOTrootless: trueseccompEnabled: trueseccompProfilePath: /usr/share/containers/seccomp.jsonselinuxEnabled: falseserviceIsRemote: trueslirp4netns:
executable: ""package: ""version: ""swapFree: 32212254720swapTotal: 32212254720uptime: 0h 7m 16.00svariant: ""plugins:
authorization: nulllog:
- k8s-file
- none
- passthrough
- journaldnetwork:
- bridge
- macvlan
- ipvlanvolume:
- localregistries:
search:
- docker.iostore:
configFile: /home/user/.config/containers/storage.confcontainerStore:
number: 0paused: 0running: 0stopped: 0graphDriverName: overlaygraphOptions: {}graphRoot: /home/user/.local/share/containers/storagegraphRootAllocated: 1081101176832graphRootUsed: 942125056graphStatus:
Backing Filesystem: extfsNative Overlay Diff: "true"Supports d_type: "true"Supports shifting: "false"Supports volatile: "true"Using metacopy: "false"imageCopyTmpDir: /var/tmpimageStore:
number: 1runRoot: /run/user/1000/containerstransientStore: falsevolumePath: /home/user/.local/share/containers/storage/volumesversion:
APIVersion: 5.3.1Built: 1732147200BuiltTime: Thu Nov 21 01:00:00 2024GitCommit: ""GoVersion: go1.22.7Os: linuxOsArch: linux/amd64Version: 5.3.1
kind/bugCategorizes issue or PR as related to a bug.machinenetworkNetworking related issue or featureremoteProblem is in podman-remotewindowsissue/bug on Windows
Issue Description
I am trying to reach my host from a container (which I use for openapi-generator).
I have already tried different flags and settings.
Neither
host.containers.internal
nor--network=host
can I access the swagger api on localhost:5001.If I execute
ps auxww | grep pasta
in the podman-machine-default:I start an alpine container:
podman run --rm -it alpine sh
Then these are the following outputs:
These is the
ip route
output inside the podman machine:I have the problem with Podman v 5.0.0 / 5.3.0 and 5.3.x
The only thing that has worked so far is using
networkingMode=mirrored
in the .wslconfigand starting the container with
--network=host
.Then I can access the swagger api directly with localhost or 127.0.0.1. However, this causes other problems with my DB, which is why this is not an option!
Steps to reproduce the issue
Describe the results you received
From inside the container!
or
but when I ping:
Describe the results you expected
Host service, like a swagger api, should be reachable from inside the container via
host.containers.internal
Output should be similar to the curl command from the windows host (powershell):
podman info output
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
Yes
Additional environment details
No networkingMode changed
Additional information
No response
The text was updated successfully, but these errors were encountered: