mirror of
https://github.com/docker/docs.git
synced 2026-04-12 14:25:46 +07:00
Fix container naming
This commit is contained in:
@@ -8,6 +8,7 @@ from docopt import docopt
|
||||
from inspect import getdoc
|
||||
|
||||
from .. import __version__
|
||||
from ..service import get_container_name
|
||||
from ..service_collection import ServiceCollection
|
||||
from .command import Command
|
||||
|
||||
@@ -77,7 +78,7 @@ class TopLevelCommand(Command):
|
||||
"""
|
||||
for service in self.service_collection:
|
||||
for container in service.containers:
|
||||
print container['Names'][0]
|
||||
print get_container_name(container)
|
||||
|
||||
def run(self, options):
|
||||
"""
|
||||
|
||||
@@ -103,4 +103,6 @@ def parse_name(name):
|
||||
|
||||
|
||||
def get_container_name(container):
|
||||
return container['Names'][0][1:]
|
||||
for name in container['Names']:
|
||||
if len(name.split('/')) == 2:
|
||||
return name[1:]
|
||||
|
||||
Reference in New Issue
Block a user