mirror of https://github.com/docker/compose.git
Only set AttachStdin/out/err for one-off containers
If we're just streaming logs from `docker-compose up`, we don't need to set AttachStdin/out/err, and doing so results in containers with different configuration depending on whether `up` or `run` were invoked with `-d` or not. Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
parent
1e6d912fbc
commit
3304c68891
|
@ -299,7 +299,6 @@ class TopLevelCommand(Command):
|
|||
start_deps=True,
|
||||
recreate=False,
|
||||
insecure_registry=insecure_registry,
|
||||
detach=options['-d']
|
||||
)
|
||||
|
||||
tty = True
|
||||
|
@ -461,7 +460,6 @@ class TopLevelCommand(Command):
|
|||
start_deps=start_deps,
|
||||
recreate=recreate,
|
||||
insecure_registry=insecure_registry,
|
||||
detach=detached,
|
||||
do_build=not options['--no-build'],
|
||||
)
|
||||
|
||||
|
|
|
@ -209,7 +209,6 @@ class Project(object):
|
|||
start_deps=True,
|
||||
recreate=True,
|
||||
insecure_registry=False,
|
||||
detach=False,
|
||||
do_build=True):
|
||||
running_containers = []
|
||||
for service in self.get_services(service_names, include_deps=start_deps):
|
||||
|
@ -220,7 +219,6 @@ class Project(object):
|
|||
|
||||
for container in create_func(
|
||||
insecure_registry=insecure_registry,
|
||||
detach=detach,
|
||||
do_build=do_build):
|
||||
running_containers.append(container)
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ class Service(object):
|
|||
# Create enough containers
|
||||
containers = self.containers(stopped=True)
|
||||
while len(containers) < desired_num:
|
||||
containers.append(self.create_container(detach=True))
|
||||
containers.append(self.create_container())
|
||||
|
||||
running_containers = []
|
||||
stopped_containers = []
|
||||
|
@ -285,14 +285,12 @@ class Service(object):
|
|||
def start_or_create_containers(
|
||||
self,
|
||||
insecure_registry=False,
|
||||
detach=False,
|
||||
do_build=True):
|
||||
containers = self.containers(stopped=True)
|
||||
|
||||
if not containers:
|
||||
new_container = self.create_container(
|
||||
insecure_registry=insecure_registry,
|
||||
detach=detach,
|
||||
do_build=do_build,
|
||||
)
|
||||
return [self.start_container(new_container)]
|
||||
|
@ -393,6 +391,9 @@ class Service(object):
|
|||
|
||||
container_options['name'] = self.get_container_name(number, one_off)
|
||||
|
||||
if 'detach' not in container_options:
|
||||
container_options['detach'] = True
|
||||
|
||||
# If a qualified hostname was given, split it into an
|
||||
# unqualified hostname and a domainname unless domainname
|
||||
# was also given explicitly. This matches the behavior of
|
||||
|
|
Loading…
Reference in New Issue