Skip to content

Add option to set container name#193

Open
dododedodonl wants to merge 1 commit intocontainers:mainfrom
dododedodonl:add-container-name-flag
Open

Add option to set container name#193
dododedodonl wants to merge 1 commit intocontainers:mainfrom
dododedodonl:add-container-name-flag

Conversation

@dododedodonl
Copy link
Copy Markdown
Contributor

When converting from a compose file, container_name might not be set. The flag added gives the option to set the service's key as container name when it is not set already.

Signed-off-by: Tom Janssen <tom@dcc.team>
@k9withabone
Copy link
Copy Markdown
Member

k9withabone commented Feb 25, 2026

@TheRealBecks what do you think of this new option?

@TheRealBecks
Copy link
Copy Markdown
Collaborator

TheRealBecks commented Mar 9, 2026

I may have overlooked it, but how do I set --add-container-name when there are several services defined? When there's no container_name Podman generates names for services as <project-name>-<service-name>-<number-starting-at-1>.

Also container_name does not allow scaling as there can't be two containers with the same name for one service, see compose-spec#container_name

So keep in mind that this command collides with:

@k9withabone Is there a way to make scale and container_name mutually exclusive per service? replicas is not yet implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants