|
@@ -387,17 +387,29 @@ class TopLevelCommand(Command):
|
|
|
|
|
|
They can be started again with `docker-compose start`.
|
|
|
|
|
|
- Usage: stop [SERVICE...]
|
|
|
+ Usage: stop [options] [SERVICE...]
|
|
|
+
|
|
|
+ Options:
|
|
|
+ -t, --timeout TIMEOUT Specify a shutdown timeout in seconds.
|
|
|
+ (default: 10)
|
|
|
"""
|
|
|
- project.stop(service_names=options['SERVICE'])
|
|
|
+ timeout = options.get('--timeout')
|
|
|
+ params = {} if timeout is None else {'timeout': int(timeout)}
|
|
|
+ project.stop(service_names=options['SERVICE'], **params)
|
|
|
|
|
|
def restart(self, project, options):
|
|
|
"""
|
|
|
Restart running containers.
|
|
|
|
|
|
- Usage: restart [SERVICE...]
|
|
|
+ Usage: restart [options] [SERVICE...]
|
|
|
+
|
|
|
+ Options:
|
|
|
+ -t, --timeout TIMEOUT Specify a shutdown timeout in seconds.
|
|
|
+ (default: 10)
|
|
|
"""
|
|
|
- project.restart(service_names=options['SERVICE'])
|
|
|
+ timeout = options.get('--timeout')
|
|
|
+ params = {} if timeout is None else {'timeout': int(timeout)}
|
|
|
+ project.restart(service_names=options['SERVICE'], **params)
|
|
|
|
|
|
def up(self, project, options):
|
|
|
"""
|
|
@@ -416,14 +428,17 @@ class TopLevelCommand(Command):
|
|
|
Usage: up [options] [SERVICE...]
|
|
|
|
|
|
Options:
|
|
|
- --allow-insecure-ssl Allow insecure connections to the docker
|
|
|
- registry
|
|
|
- -d Detached mode: Run containers in the background,
|
|
|
- print new container names.
|
|
|
- --no-color Produce monochrome output.
|
|
|
- --no-deps Don't start linked services.
|
|
|
- --no-recreate If containers already exist, don't recreate them.
|
|
|
- --no-build Don't build an image, even if it's missing
|
|
|
+ --allow-insecure-ssl Allow insecure connections to the docker
|
|
|
+ registry
|
|
|
+ -d Detached mode: Run containers in the background,
|
|
|
+ print new container names.
|
|
|
+ --no-color Produce monochrome output.
|
|
|
+ --no-deps Don't start linked services.
|
|
|
+ --no-recreate If containers already exist, don't recreate them.
|
|
|
+ --no-build Don't build an image, even if it's missing
|
|
|
+ -t, --timeout TIMEOUT When attached, use this timeout in seconds
|
|
|
+ for the shutdown. (default: 10)
|
|
|
+
|
|
|
"""
|
|
|
insecure_registry = options['--allow-insecure-ssl']
|
|
|
detached = options['-d']
|
|
@@ -439,7 +454,7 @@ class TopLevelCommand(Command):
|
|
|
start_links=start_links,
|
|
|
recreate=recreate,
|
|
|
insecure_registry=insecure_registry,
|
|
|
- detach=options['-d'],
|
|
|
+ detach=detached,
|
|
|
do_build=not options['--no-build'],
|
|
|
)
|
|
|
|
|
@@ -458,7 +473,9 @@ class TopLevelCommand(Command):
|
|
|
signal.signal(signal.SIGINT, handler)
|
|
|
|
|
|
print("Gracefully stopping... (press Ctrl+C again to force)")
|
|
|
- project.stop(service_names=service_names)
|
|
|
+ timeout = options.get('--timeout')
|
|
|
+ params = {} if timeout is None else {'timeout': int(timeout)}
|
|
|
+ project.stop(service_names=service_names, **params)
|
|
|
|
|
|
|
|
|
def list_containers(containers):
|