mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
3 files changed
+22
-13
No files matched your search
@@ -202,7 +202,7 @@ class DockerVM(BaseVM):
|
||||
|
||||
# We mount our own etc/network
|
||||
network_config = self._create_network_config()
|
||||
binds.append("{}:/etc/network:rw".format(network_config))
|
||||
binds.append("{}:/gns3volumes/etc/network:rw".format(network_config))
|
||||
|
||||
self._volumes = ["/etc/network"]
|
||||
|
||||
@@ -212,7 +212,7 @@ class DockerVM(BaseVM):
|
||||
for volume in volumes.keys():
|
||||
source = os.path.join(self.working_dir, os.path.relpath(volume, "/"))
|
||||
os.makedirs(source, exist_ok=True)
|
||||
binds.append("{}:{}".format(source, volume))
|
||||
binds.append("{}:/gns3volumes{}".format(source, volume))
|
||||
self._volumes.append(volume)
|
||||
|
||||
return binds
|
||||
|
||||
@@ -28,9 +28,18 @@ if [ ! -d /tmp/gns3/bin ]; then
|
||||
/gns3/bin/busybox --install -s /tmp/gns3/bin
|
||||
fi
|
||||
|
||||
# Restore file permission
|
||||
# Restore file permission and mount volumes
|
||||
for i in $(echo "$GNS3_VOLUMES" | tr ":" "\n")
|
||||
do
|
||||
# Copy original files if destination is empty (first start)
|
||||
if ! [ "$(ls -A /gns3volumes$i)" ]; then
|
||||
for file in $(ls -A "$i")
|
||||
do
|
||||
cp -a "$i/$file" "/gns3volumes$i/$file"
|
||||
done
|
||||
fi
|
||||
|
||||
mount --bind "/gns3volumes$i" "$i"
|
||||
if [ -f "$i/.gns3_perms" ]
|
||||
then
|
||||
while IFS=: read PERMS OWNER GROUP FILE
|
||||
|
||||
Reference in new issue
Block a user