Bug: specify network mode for backup process container
This commit is contained in:
parent
ff06c5c90f
commit
1e8131d2b0
|
@ -8,7 +8,7 @@ logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def run(image: str = None, command: str = None, volumes: dict = None,
|
def run(image: str = None, command: str = None, volumes: dict = None,
|
||||||
environment: dict = None, labels: dict = None):
|
environment: dict = None, labels: dict = None, source_container_id: str = None):
|
||||||
logger.info("Starting backup container")
|
logger.info("Starting backup container")
|
||||||
config = Config()
|
config = Config()
|
||||||
client = docker.DockerClient(base_url=config.docker_base_url)
|
client = docker.DockerClient(base_url=config.docker_base_url)
|
||||||
|
@ -17,10 +17,11 @@ def run(image: str = None, command: str = None, volumes: dict = None,
|
||||||
image,
|
image,
|
||||||
command,
|
command,
|
||||||
labels=labels,
|
labels=labels,
|
||||||
# auto_remove=True,
|
# auto_remove=True, # We remove the container further down
|
||||||
detach=True,
|
detach=True,
|
||||||
environment=environment,
|
environment=environment,
|
||||||
volumes=volumes,
|
volumes=volumes,
|
||||||
|
network_mode=f'container:{source_container_id}', # Reuse original container's network stack.
|
||||||
working_dir=os.getcwd(),
|
working_dir=os.getcwd(),
|
||||||
tty=True,
|
tty=True,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue