podman: Podman Machine on Mac: podman build --net doesn't work

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

I’m using podman machine on a mac. I have the requirement to spawn a container which is available in an own network and accessible for container images during build (it’s an authentication proxy that handles all credential / ssl stuff so that I don’t need to pass it to the image to build). Creating the network for that container works, but referencing it using --net when calling podman build does not.

Steps to reproduce the issue:

podman network create esc

Tried to build with

podman build --net=esc -t something .

Describe the results you received:

Error: checking network namespace: stat esc: no such file or directory
podman network ls:
NETWORK ID    NAME        VERSION     PLUGINS
2f259bab93aa  podman      0.4.0       bridge,podman-machine,portmap,firewall,tuning
177b7cb06867  esc         0.4.0       bridge,portmap,firewall,tuning,dnsname,podman-machine

Describe the results you expected: A successful build =)

Additional information you deem important (e.g. issue happens only occasionally):

  • always happens, with --net and --network.

Output of podman version:

podman version 3.4.1

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.23.1
  cgroupControllers:
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.0.30-2.fc35.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.30, commit: '
  cpus: 1
  distribution:
    distribution: fedora
    variant: coreos
    version: "35"
  eventLogger: journald
  hostname: localhost.localdomain
  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: 5.14.14-300.fc35.x86_64
  linkmode: dynamic
  logDriver: journald
  memFree: 471703552
  memTotal: 2061524992
  ociRuntime:
    name: crun
    package: crun-1.2-1.fc35.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.2
      commit: 4f6c8e0583c679bfee6a899c05ac6b916022561b
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +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,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.1.12-2.fc35.x86_64
    version: |-
      slirp4netns version 1.1.12
      commit: 7a104a101aa3278a2152351a082a6df71f57c9a3
      libslirp: 4.6.1
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.0
  swapFree: 0
  swapTotal: 0
  uptime: 1h 47m 17.64s (Approximately 0.04 days)
plugins:
  log:
  - k8s-file
  - none
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries:
  search:
  - docker.io
store:
  configFile: /var/home/core/.config/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /var/home/core/.local/share/containers/storage
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 13
  runRoot: /run/user/1000/containers
  volumePath: /var/home/core/.local/share/containers/storage/volumes
version:
  APIVersion: 3.4.1
  Built: 1634740316
  BuiltTime: Wed Oct 20 14:31:56 2021
  GitCommit: ""
  GoVersion: go1.16.8
  OsArch: linux/amd64
  Version: 3.4.1

Package info (e.g. output of rpm -q podman or apt list podman):

brew list podman
/usr/local/Cellar/podman/3.4.1/bin/podman
/usr/local/Cellar/podman/3.4.1/bin/podman-remote
/usr/local/Cellar/podman/3.4.1/etc/bash_completion.d/podman
/usr/local/Cellar/podman/3.4.1/libexec/gvproxy
/usr/local/Cellar/podman/3.4.1/share/fish/vendor_completions.d/podman.fish
/usr/local/Cellar/podman/3.4.1/share/man/ (160 files)
/usr/local/Cellar/podman/3.4.1/share/zsh/site-functions/_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)

No, can only use the brew version provided on my mac.

Additional environment details (AWS, VirtualBox, physical, etc.): Just a podman machine instance with qemu.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (12 by maintainers)

Commits related to this issue

Most upvoted comments

Yes buildah uses partially broken and outdated code for CNI. No one complains because it still uses host networking by default. I think we should move the new podman networking code into c/common and make buildah use it. Supporting netavark for buildah should be very easy then. The same goes for other networking code such as /etc/hosts and /etc/resolv.conf where we have minor differences in both of them for no reason.