mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-05 14:51:13 +02:00
Backport from v3: install Docker resources in a writable location at runtime.
This commit is contained in:
6 files changed
+142
-48
No files matched your search
@@ -242,10 +242,13 @@ class DockerVM(BaseNode):
|
||||
:returns: Return the path that we need to map to local folders
|
||||
"""
|
||||
|
||||
resources = get_resource("compute/docker/resources")
|
||||
if not os.path.exists(resources):
|
||||
raise DockerError("{} is missing can't start Docker containers".format(resources))
|
||||
binds = ["{}:/gns3:ro".format(resources)]
|
||||
try:
|
||||
resources_path = self.manager.resources_path()
|
||||
except OSError as e:
|
||||
raise DockerError(f"Cannot access resources: {e}")
|
||||
|
||||
log.info(f'Mount resources from "{resources_path}"')
|
||||
binds = ["{}:/gns3:ro".format(resources_path)]
|
||||
|
||||
# We mount our own etc/network
|
||||
try:
|
||||
@@ -460,6 +463,8 @@ class DockerVM(BaseNode):
|
||||
Starts this Docker container.
|
||||
"""
|
||||
|
||||
await self.manager.install_resources()
|
||||
|
||||
try:
|
||||
state = await self._get_container_state()
|
||||
except DockerHttp404Error:
|
||||
|
||||
Reference in new issue
Block a user