Skip to content
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

[Bug]: network modes none and host should create entries in NetworkSettings.Networks #17385

Closed
SoMuchForSubtlety opened this issue Feb 6, 2023 · 1 comment · Fixed by #17386
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. network Networking related issue or feature

Comments

@SoMuchForSubtlety
Copy link
Contributor

SoMuchForSubtlety commented Feb 6, 2023

Issue Description

When creating a container with network mode host or none using docker, the network settings contain entries with those names, respectively. With podman, the networks map is empty.

Steps to reproduce the issue

Steps to reproduce the issue

  1. run a container with network mode host or none (podman run --network=host alpine sleep 1000)
  2. check the container's network settings (podman inspect $id)

Describe the results you received

No entries in the networks map.

Describe the results you expected

Examples from docker

"Networks": {
    "none": {
        "IPAMConfig": null,
        "Links": null,
        "Aliases": null,
        "NetworkID": "840780b61c9fe68c120a0ba5b71158bfab274e9874ff8adba18381c962647e32",
        "EndpointID": "21b3555e8d0431ba777bd7e5e0f3e9f38525c5cf98cd9c3ead83d83bcaed15b2",
        "Gateway": "",
        "IPAddress": "",
        "IPPrefixLen": 0,
        "IPv6Gateway": "",
        "GlobalIPv6Address": "",
        "GlobalIPv6PrefixLen": 0,
        "MacAddress": "",
        "DriverOpts": null
    }
}
"Networks": {
    "host": {
        "IPAMConfig": null,
        "Links": null,
        "Aliases": null,
        "NetworkID": "7713bb616c867a4104cdd9c1f70f32c7c5b5f1714d5542410386fcb8b33d0ca9",
        "EndpointID": "158dea76994f883b58b373a56b4daef5a7b2b4e36cc041a6f09c73832738a2aa",
        "Gateway": "",
        "IPAddress": "",
        "IPPrefixLen": 0,
        "IPv6Gateway": "",
        "GlobalIPv6Address": "",
        "GlobalIPv6PrefixLen": 0,
        "MacAddress": "",
        "DriverOpts": null
    }
}

podman info output

host:
  arch: amd64
  buildahVersion: 1.29.0
  cgroupControllers:
  - cpu
  - io
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.5-1.fc37.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.5, commit: '
  cpuUtilization:
    idlePercent: 96.34
    systemPercent: 0.95
    userPercent: 2.71
  cpus: 16
  distribution:
    distribution: fedora
    variant: workstation
    version: "37"
  eventLogger: journald
  hostname: honestmistake
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 6.1.9-200.fc37.x86_64
  linkmode: dynamic
  logDriver: journald
  memFree: 21072125952
  memTotal: 32835108864
  networkBackend: netavark
  ociRuntime:
    name: crun
    package: crun-1.7.2-3.fc37.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.7.2
      commit: 0356bf4aff9a133d655dc13b1d9ac9424706cac4
      rundir: /run/user/1000/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJL
  os: linux
  remoteSocket:
    exists: true
    path: /run/user/1000/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.0-8.fc37.x86_64
    version: |-
      slirp4netns version 1.2.0
      commit: 656041d45cfca7a4176f6b7eed9e4fe6c11e8383
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 4
      libseccomp: 2.5.3
  swapFree: 8589930496
  swapTotal: 8589930496
  uptime: 0h 34m 4.00s
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries:
  localhost:
    Blocked: false
    Insecure: true
    Location: localhost
    MirrorByDigestOnly: false
    Mirrors: null
    Prefix: localhost
    PullFromMirror: ""
  search:
  - docker.io
store:
  configFile: /home/jakob/.config/containers/storage.conf
  containerStore:
    number: 64
    paused: 0
    running: 5
    stopped: 59
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /home/jakob/.local/share/containers/storage
  graphRootAllocated: 510405902336
  graphRootUsed: 358397812736
  graphStatus:
    Backing Filesystem: btrfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 107
  runRoot: /run/user/1000/containers
  transientStore: false
  volumePath: /home/jakob/.local/share/containers/storage/volumes
version:
  APIVersion: 4.4.0
  Built: 1675341170
  BuiltTime: Thu Feb  2 13:32:50 2023
  GitCommit: ""
  GoVersion: go1.19.5
  Os: linux
  OsArch: linux/amd64

Podman in a container

No

Privileged Or Rootless

Rootless

Upstream Latest Release

Yes

Additional environment details

No response

Additional information

This is required for full docker compatibility, to make the testcontainers-java test suite pass, see testcontainers/testcontainers-java#6158

I'm not sure how big the scope of the required changes for this is, but I'd be happy to contribute a fix if someone can point me in the right direction.

@SoMuchForSubtlety SoMuchForSubtlety added the kind/bug Categorizes issue or PR as related to a bug. label Feb 6, 2023
@rhatdan
Copy link
Member

rhatdan commented Feb 6, 2023

@Luap99 PTAL

@Luap99 Luap99 added the network Networking related issue or feature label Feb 7, 2023
rhatdan added a commit to rhatdan/podman that referenced this issue Mar 8, 2023
This will match Docker behaviour.

Fixes: containers#17385

Signed-off-by: Daniel J Walsh <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Aug 30, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. network Networking related issue or feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants