Skip to content

"container_name:" is ignored by 'podman-compose run' #1430

@bam80

Description

@bam80

Describe the bug
container_name services top-level element is not honored by podman-compose run.
Instead, the name is generated on each run.

To Reproduce

  1. place container_name: <name> element to your compose file
  2. podman-compose --verbose run <service>
  3. podman container list -a

Expected behavior
There should be a container listed with the <name> name.

Actual behavior
Container with generated name of devcontainer_<name>_tmp<some_number> is added.

Output

$ podman-compose version
podman-compose version 1.5.0
podman version 5.8.1

# run "omim" service
$ podman-compose --verbose run omim
INFO:podman_compose:['podman', '--version', '']
INFO:podman_compose:using podman version: 5.8.1
INFO:podman_compose:podman pod exists pod_devcontainer
INFO:podman_compose:exit code: 0
INFO:podman_compose:['podman', 'inspect', '-t', 'image', '-f', '{{.Id}}', 'devcontainer_omim']
INFO:podman_compose:podman run --name=devcontainer_omim_tmp17542 ...
# note the service name used: "devcontainer_omim_tmp17542"

Environment:

  • OS: Linux

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