podman: Port binding not working

Is this a BUG REPORT or FEATURE REQUEST?:

/kind bug

Description

I’m unable to access a port bound to the host.

Steps to reproduce the issue:

$ podman run -d -p 8000:8000/tcp --name=http python:alpine python -m http.server

Describe the results you received:

$ podman port http
8000/udp -> 0.0.0.0:8000
8000/tcp -> 0.0.0.0:8000
$ podman exec http ps
PID   USER     TIME   COMMAND
    1 root       0:00 python -m http.server
    6 root       0:00 ps
$ curl localhost:8000
curl: (7) Failed to connect to localhost port 8000: Connection refused
$ ss -lt
State                 Recv-Q                 Send-Q                                  Local Address:Port                                 Peer Address:Port
LISTEN                0                      128                                           0.0.0.0:ssh                                       0.0.0.0:*
LISTEN                0                      128                                              [::]:ssh                                          [::]:*

Describe the results you expected:

A service listening on port 8000 on the host.

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

Output of podman version:

podman version 0.4.4-dev

Output of podman info:

sudo podman info
host:
  MemFree: 1146949632
  MemTotal: 4135124992
  SwapFree: 0
  SwapTotal: 0
  arch: amd64
  cpus: 2
  hostname: ip-10-0-0-101
  kernel: 4.15.0-1001-aws
  os: linux
  uptime: 11h 24m 59.83s (Approximately 0.46 days)
insecure registries:
  registries: null
registries:
  registries:
  - docker.io
store:
  ContainerStore:
    number: 1
  GraphDriverName: vfs
  GraphOptions:
  - vfs.override_kernel_check=true
  GraphRoot: /var/lib/containers/storage
  GraphStatus: {}
  ImageStore:
    number: 5
  RunRoot: /var/run/containers/storage

Additional environment details (AWS, VirtualBox, physical, etc.):

I tested both inside a docker container and on AWS and got the same results.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 20 (14 by maintainers)

Most upvoted comments

@ipmb any chance you have an 87, 100, and 200 file in /etc/cni/net.d ? And if you temporarily move 100 and 200 out of the dir, does it work?