Skip to content

"ports" attribute is ignored for service "run" command #1276

@bam80

Description

@bam80

Describe the bug
If the service container is created with podman-compose run command, it's ports attribute is ignored.

To Reproduce

  • Consider Echo Service example, make sure it works as the README suggests:
    • podman-compose up
    • test the service with curl:
      curl -X POST -d "foobar" http://localhost:8080/; echo
  • podman-compose down
  • Now run the service with the "run" command:
    podman-compose run web
  • re-test the service with the same curl command above

Expected behavior
There should be the same curl output as for podman-compose up.

Actual behavior

curl: (7) Failed to connect to localhost port 8080 after 0 ms: Could not connect to server

Output

$ podman-compose version
podman-compose version 1.4.0
podman version 5.5.0

$ podman-compose up
...

$ curl -X POST -d "foobar" http://localhost:8080/; echo
CLIENT VALUES:
client_address=10.89.1.2
command=POST
real path=/
query=nil
request_version=1.1
request_uri=http://localhost:8080/

SERVER VALUES:
server_version=nginx: 1.10.0 - lua: 10001

HEADERS RECEIVED:
accept=*/*
content-length=6
content-type=application/x-www-form-urlencoded
host=localhost:8080
user-agent=curl/8.11.1
BODY:
foobar

Environment:

  • OS: Linux
  • podman version: 5.5.0
  • podman compose version: 1.4.0

See also:
#1277

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions