Specify all HostConfig at create time

This is required for Swarm integration: the cluster needs to know
about config like `links` and `volumes_from` at create time so that it
can co-schedule containers.

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
Aanand Prasad 2015-02-16 14:30:31 +00:00
commit eef4bc3917
4 changed files with 64 additions and 44 deletions

View file

@ -32,4 +32,4 @@ def docker_client():
)
timeout = int(os.environ.get('DOCKER_CLIENT_TIMEOUT', 60))
return Client(base_url=base_url, tls=tls_config, version='1.14', timeout=timeout)
return Client(base_url=base_url, tls=tls_config, version='1.15', timeout=timeout)

View file

@ -328,20 +328,20 @@ class TopLevelCommand(Command):
if options['--user']:
container_options['user'] = options.get('--user')
if not options['--service-ports']:
container_options['ports'] = []
container = service.create_container(
one_off=True,
insecure_registry=insecure_registry,
**container_options
)
service_ports = None
if options['--service-ports']:
service_ports = service.options['ports']
if options['-d']:
service.start_container(container, ports=service_ports, one_off=True)
service.start_container(container)
print(container.name)
else:
service.start_container(container, ports=service_ports, one_off=True)
service.start_container(container)
dockerpty.start(project.client, container.id, interactive=not options['-T'])
exit_code = container.wait()
if options['--rm']: