Skip to content

Commit 533f9da

Browse files
authored
Add clab.exec parameter to execute commands when starting containers (#2838)
Closes #2806
1 parent 8678ba8 commit 533f9da

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

docs/labs/clab.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ You can also change these *containerlab* parameters:
364364
* **clab.type** to set node type (used by Nokia SR OS and Nokia SR Linux).
365365
* **clab.dns** to [configure DNS servers and search domains](https://containerlab.dev/manual/nodes/#dns)
366366
* **clab.env** to [set container environment](https://containerlab.dev/manual/nodes/#env) (used to [set interface names for Arista cEOS](https://containerlab.dev/manual/kinds/ceos/#additional-interface-naming-considerations))
367+
* **clab.exec** to execute a list of commands after the container has started. If you want to start shell scripts, use **clab.binds** or **clab.config_templates** to make those scripts available to the container
367368
* **clab.license** to configure a license file for those platforms that require one
368369
* **clab.ports** to [map container ports to host ports](https://containerlab.dev/manual/nodes/#ports)
369370
* **clab.cmd** to [change the command of a container image](https://containerlab.dev/manual/nodes/#cmd).

netsim/providers/clab.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
description: containerlab with Docker
55
config: clab.yml
66
lab_prefix: "clab" # Containerlab default, set to "" to remove prefix
7-
node_config_attributes: [ type, cmd, dns, env, license, ports, startup-delay, restart-policy ]
7+
node_config_attributes: [ type, cmd, dns, env, exec, license, ports, startup-delay, restart-policy ]
88
template: clab.j2
99
version: 0.69.3
1010
# Preserve env to allow user to configure PATH
@@ -47,6 +47,7 @@ attributes:
4747
startup-delay: int
4848
restart-policy: str
4949
network-mode: str
50+
exec: { type: list, _subtype: str }
5051
interface:
5152
name: str
5253
link:

0 commit comments

Comments
 (0)