srl-labs / containerlab

container-based networking labs
https://containerlab.dev
BSD 3-Clause "New" or "Revised" License
1.51k stars 260 forks source link

bind mount directories should be possible to set per kind and node #88

Closed hellt closed 3 years ago

hellt commented 4 years ago

To allow mounting files to the containerlab modes, the mount option have to be created for kinds and nodes. The use case is to add custom binaries or configs for testing containers (like adding gobgp to a vanilla alpine)

kind_defaults:
    my_tools:
      type: custom
      image: pklepikov/ubuntu-tools
      mounts:
       - $(pwd)/exabgp /home/admin/exabgp
       - $(pwd)/gobgp /home/admin/gobgp
karimra commented 4 years ago

We need to add the permissions (ro/rw) as well, so maybe something like: -$(pwd)/exabgp:/home/admin/exabgp:rw

defaults to ro just like docker