daemon: added initial support to docker nodes for setting up volumes and bind mounts

This commit is contained in:
Blake Harnden 2022-05-11 13:51:02 -07:00
parent 25c3c42b40
commit fd3be57f57
3 changed files with 39 additions and 3 deletions

View file

@ -2,7 +2,7 @@
CORE data objects.
"""
from dataclasses import dataclass, field
from typing import TYPE_CHECKING, Any, List, Optional, Tuple
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple
import netaddr
@ -92,6 +92,8 @@ class NodeOptions:
image: str = None
emane: str = None
legacy: bool = False
binds: Dict[str, str] = field(default_factory=dict)
volumes: Dict[str, str] = field(default_factory=dict)
def set_position(self, x: float, y: float) -> None:
"""

View file

@ -521,6 +521,8 @@ class Session:
kwargs = dict(_id=_id, name=name, server=server)
if _class in CONTAINER_NODES:
kwargs["image"] = options.image
kwargs["binds"] = options.binds
kwargs["volumes"] = options.volumes
node = self.create_node(_class, start, **kwargs)
# set node attributes