Skip to content

Commit

Permalink
docker compat: use hyphens to join container names
Browse files Browse the repository at this point in the history
docker-compose uses - not _ to join container names to project.
not a huge thing, but for services making assumptions based on this
it can catch off guard, and is easy to make the same.
  • Loading branch information
mattp- committed Nov 29, 2024
1 parent 626e278 commit d50c8f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion podman_compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -1979,7 +1979,7 @@ def _parse_compose_file(self):

container_names_by_service[service_name] = []
for num in range(1, replicas + 1):
name0 = f"{project_name}_{service_name}_{num}"
name0 = f"{project_name}-{service_name}-{num}"
if num == 1:
name = service_desc.get("container_name", name0)
else:
Expand Down

0 comments on commit d50c8f4

Please sign in to comment.