mirror of https://github.com/docker/compose.git
Merge pull request #36 from orchardup/use-container-create-for-recreating-containers
Use Container.create to recreate containers
This commit is contained in:
commit
f47f075f02
|
@ -141,14 +141,13 @@ class Service(object):
|
||||||
if container.is_running:
|
if container.is_running:
|
||||||
container.stop(timeout=1)
|
container.stop(timeout=1)
|
||||||
|
|
||||||
intermediate_container_options = {
|
intermediate_container = Container.create(
|
||||||
'image': container.image,
|
self.client,
|
||||||
'command': 'echo',
|
image=container.image,
|
||||||
'volumes_from': container.id,
|
command='echo',
|
||||||
'entrypoint': None
|
volumes_from=container.id,
|
||||||
}
|
entrypoint=None
|
||||||
intermediate_container = self.create_container(
|
)
|
||||||
one_off=True, **intermediate_container_options)
|
|
||||||
intermediate_container.start()
|
intermediate_container.start()
|
||||||
intermediate_container.wait()
|
intermediate_container.wait()
|
||||||
container.remove()
|
container.remove()
|
||||||
|
|
Loading…
Reference in New Issue