Skip to content

"container_name" attribute is ignored for service "run" command #1277

@bam80

Description

@bam80

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

To Reproduce

  • Start Azure Vote Example:
    podman-compose up
  • Make sure there is a container with azure-vote-back name:
    $ podman container list --all 
    CONTAINER ID  IMAGE                                      COMMAND               CREATED            STATUS                     PORTS                                    NAMES
    ...
    487fe2e243c7  mcr.microsoft.com/oss/bitnami/redis:6.0.8  /opt/bitnami/scri...  15 seconds ago     Up 12 seconds              6379/tcp                                 azure-vote-back
  • podman-compose down
  • Now run the azure-vote-back service with the "run" command:
    podman-compose run azure-vote-back
  • podman container list --all

Expected behavior
There should be the same azure-vote-back container name as for podman-compose up.

Actual behavior
The name is now azure-vote_azure-vote-back_tmp39456:

$ podman container list --all 
CONTAINER ID  IMAGE                                      COMMAND               CREATED         STATUS                     PORTS                                    NAMES
...
af72859bf068  mcr.microsoft.com/oss/bitnami/redis:6.0.8  /opt/bitnami/scri...  17 minutes ago  Exited (0) 7 minutes ago   6379/tcp                                 azure-vote_azure-vote-back_tmp39456

Environment:

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

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