-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker compatibility: Container Inspect returns {} for NetworkSettings.Networks #10261
Comments
Doing some more debugging, I noticed that inside the curl container in this example, when docker is used,
But, when run with podman,
The problem is that the entry for |
The cause is that container Inspect returns empty Here's an exchange with podman:
However, that's different than what docker does. Here's the same exchange with docker:
For easier comparison, here is docker's "NetworkSettings": {
"Bridge": "",
"SandboxID": "353c0a8c511c4cae906231bafcad6d5a2ecc1ec072e7facda979ffa9018202bc",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {},
"SandboxKey": "/var/run/docker/netns/353c0a8c511c",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "f710e9bd49b67ac67da05bd835ef88533d0f039baf60131edaae68a5b808e6cb",
"Gateway": "172.17.0.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.17.0.15",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "02:42:ac:11:00:0f",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "50f6517cf3aab7ca4345d22e48cfeb2245bb1ffeadbf9a3f10126de50847af2f",
"EndpointID": "f710e9bd49b67ac67da05bd835ef88533d0f039baf60131edaae68a5b808e6cb",
"Gateway": "172.17.0.1",
"IPAddress": "172.17.0.15",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:11:00:0f",
"DriverOpts": null
}
}
} and here is podman's: "NetworkSettings": {
"Bridge": "",
"SandboxID": "",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {},
"SandboxKey": "",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {}
}
|
Do you run podman as rootless? If so you do not get any networks by default. |
I do run it rootless. Shouldn't there be a network by default? I haven't tried rootless docker, but it's documentation seems to indicate that container inspect returns NetworkSettings:
|
The default network mode as rootless is slirp4netns. If you need to join a network you have to create and specify them. |
I installed docker-rootless to see how it behaved. Here's the transcript of the same container inspect exchange:
Note that "NetworkSettings": {
"Bridge": "",
"SandboxID": "2b831fb77fc10d4a216362a8e2c9aedc2fa61b2de953da6412c9f9de6db8c7bf",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"22/tcp": [{
"HostIp": "0.0.0.0",
"HostPort": "49153"
}, {
"HostIp": "::",
"HostPort": "49153"
}]
},
"SandboxKey": "/run/user/1000/docker/netns/2b831fb77fc1",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "7e73cbc45075ccb7aaaf9ee68c713970e711917a7b9c5f683b3fde28b2b7bb42",
"Gateway": "172.17.0.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "02:42:ac:11:00:02",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "b22bf5f34e03b7912ce2e3e559b9c77cbd289ff1b0fd1ac78b0668dd997e6d01",
"EndpointID": "7e73cbc45075ccb7aaaf9ee68c713970e711917a7b9c5f683b3fde28b2b7bb42",
"Gateway": "172.17.0.1",
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:11:00:02",
"DriverOpts": null
}
}
} |
Can you provide the actual REST calls involved in reproducing? At the very
least, the output of the Podman API service with the ‘—log-level=debug’
flag added? It’s a lot easier to debug when we can limit the scope of the
issue to just Podman and this will make your issues faster to fix.
…On Fri, May 7, 2021 at 14:14 Craig Andrews ***@***.***> wrote:
Doing some more debugging, I noticed that inside the curl container in
this example, when docker is used, /etc/hosts looks like:
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.17.0.19 host.testcontainers.internal
172.17.0.20 1c3a400a510b
But, when run with podman, /etc/hosts looks like:
127.0.0.1 view-localhost
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 craigatwork
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 craigatwork
# used by slirp4netns
10.0.2.100 d3c2d1fd3eab mystifying_torvalds
The problem is that the entry for host.testcontainers.internal is missing
when run with podman.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#10261 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3AOCEMUWHGUAQYD4EVYOLTMQUZPANCNFSM44KVKUGQ>
.
|
I ran podman with ‘—log-level=debug’, then ran Here's the resulting log output: |
Can you retry with latest master. I think it should work now. |
Reopen if we are mistaken. |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Steps to reproduce the issue:
Java 11 (or later) is a prerequisite for running this test.
Clone https://github.com/candrews/podman-testcontainers-issue
Run
./test-podman.sh
Describe the results you received:
The test fails. Looking at the stdout of the failing test:
Describe the results you expected:
The test should pass; run
./test-docker.sh
to run against docker and observe the test passing.Additional information you deem important (e.g. issue happens only occasionally):
Here's a log of the socket when run against docker (which works):
docker.log
And here's a log of the same test run against podman (which fails):
podman.log
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
Fedora 34
The text was updated successfully, but these errors were encountered: